Make your self-signed certificate trusted by Chrome

When you are getting tired of that warning you get for your self-signed certificates when running your site locally you should add your certificates to your trusted certification store.

These instructions are for Windows and works for me™ in Chrome 60.

Create a self-signed certificate with a DnsName

Create a new certificate with powershell "New-SelfSignedCertificate -DnsName localhost -CertStoreLocation cert:\LocalMachine\My". The DnsName is important and if you use a custom domain via a host file you should add the domain you use there.

Make sure you use this certificate on your localhost


Export the certificate from Chrome

  1. Go to your localhost website and open up the inspector
  2. Under the security tab, click the "View Certificate" button.
  3. Go to the details tab in the dialog and click "Copy to file"
  4. Follow the wizard and choose the Cryptographic Message Syntax Standard - PKCS #7 (i do not think the "Include all checkbox" is important)
  5. Save it somewhere.

Import the certificate to the "Trusted Root Certification Authorites"

  1. Go to Chrome Settings
  2. Click advanced at the bottom
  3. Click the Manage Certificates link to open the certificate dialog
  4. Click import
  5. Follow the wizard and pick your exorted certificate file
  6. Click browse and choose "Trusted Root Certification Authorites"
  7. Done!

After this you should restart Chrome and you should not get any warnings.

All this information was collected at various places in this Stack Overflow question: