Getting Chrome to accept self-signed localhost certificate
For localhost
only
Simply paste this in your chrome:
chrome://flags/#allow-insecure-localhost
You should see highlighted text saying:
Allow invalid certificates for resources loaded from localhost
Click Enable.
Other sites
Try typing thisisunsafe
anywhere on the window, and the browser should let you visit the page.
-OR-
For a local self-signed cert that avoids arcane commands, specialized knowledge, and manual steps try mkcert
from this answer.
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 openDeveloper Tools > Security
, and selectView certificate
. - Click the
Details tab > Export
. ChoosePKCS #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 choosePKCS #7, single certificate
as the file type. - If prompted certification store, choose Trusted Root Certificate Authorities
- Check all boxes and click OK. Restart Chrome.