I had this kind of error. The certificate was a sub-domain wild card one. I had to import the private key into "Trusted People" store for LocalMachine and this error disappeared. Like others have pointed out, you can also try importing the private key into "Trusted Root" store for LocalMachine.