Web development: Accepting a self-signed certificate in Google Chrome

Updated . Posted . Visible to the public.

Working with a self-signed certificate is much easier, when the browser accepts it.

Google Chrome

Warnings from chrome might not be accurate

Even though the certificate is working locally, chrome might still complain that the certificate is not valid and the connection is not secure while blotting out the "https" part of the url.

Accept a specific certificate

  • Go to chrome://settings/certificates
  • Under "Authorities", click "Import"
  • Select the certificate file (.crt)
  • Check "Trust this certificate for identifying websites"
  • Close any related tabs

Disable all certificate checks

To accept any self-generated certificate during a session, you can also start chrome with the --ignore-certificate-errors switch:

google-chrome --ignore-certificate-errors &

Warning

This flag should not be used in general or for browsing the internet. You will also see a warning in the browser:
"You are using an unsupported command-line flag: --ignore-certificate-errors. Stability and security will suffer."

Dominik Schöler
Last edit
Felix Eschey
License
Source code in this card is licensed under the MIT License.
Posted by Dominik Schöler to makandra dev (2022-08-24 09:54)