Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created a self-signed certificate on Windows 7 and deployed a web site with this certificate just to try it out.

When I configured the HTTPS endpoint and visit the site with HTTPS protocol, I get the "not a trusted cert" error as expected.

Then I try to make this cert a trusted one on my machine with following PowerShell code:

$cert = (get-item cert:\CurrentUser\MY\1D5B3DEF207B70C7426953315A8C06EB38E50FAA)
$store = get-item cert:\LocalMachine\Root

It didn't work, I still get the same error. Then, I delete it from trusted certs list and tried with the below code again:

$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("c:\certs\")
$store = get-item cert:\LocalMachine\Root

That didn't work either. What am I missing?

share|improve this question

Your code looks fine and I'm assuming you're not getting any errors either. A bunch of things to check:

  • Open the certificates MMC and make sure your cert is being added.
  • Check the common name and subject alternative names of the cert. The domain of the URL you put in the browser has to match one.
  • Make sure the certificate not after date is not in the past.
  • Make sure you are using a web client that uses the Windows trust store. Firefox has its own.
  • Compare the certificate SHA1 hash from the browser to the one you are installing to make sure its the right one.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.