I have created a self-signed SSL certificate for the localhost CN. Firefox accepts this certificate after initially complaining about it, as expected. Chrome and IE, however, refuse to accept it, even after adding the certificate to the system certificate store under Trusted Roots. Even though the certificate is listed as correctly installed when I click "View certificate information" in Chrome's HTTPS popup, it still insists the certificate cannot be trusted.
What am I supposed to do to get Chrome to accept the certificate and stop complaining about it?
解决方案
This worked for me:
Using Chrome, hit a page on your server via HTTPS and continue past the red warning page (assuming you haven't done this already).
Open up Chrome Settings > Show advanced settings > HTTPS/SSL > Manage Certificates.
Click the Authorities tab and scroll down to find your certificate under the Organization Name that you gave to the certificate.
Select it, click Edit (NOTE: in recent versions of Chrome, the button is now "Advanced" instead of "Edit"), check all the boxes and click OK. You may have to restart Chrome.
You should get the nice green lock on your pages now.
EDIT: I tried this again on a new machine and the certificate did not appear on the Manage Certificates window just by continuing from the red untrusted certificate page. I had to do the following:
On the page with the untrusted certificate (https:// is crossed out in red), click the lock > Certificate Information. NOTE: on newer versions of chrome, you have to open Developer Tools > Security, and select View certificate.
Click the Details tab > Export. Choose PKCS #7, single certificate as the file format.
Then follow my original instructions to get to the Manage Certificates page. Click the Authorities tab > Import and choose the file to which you exported the certificate, and make sure to choose PKCS #7, single certificate as the file type.
If prompted certification store, choose Trusted Root Certificate Authorities
Check all boxes and click OK. Restart Chrome.