google-chrome

How to avoid the "Your connection is not private" screen when developing an HTTP2 site locally?


When I'm developing using Node's http2 library (which only supports HTTPS, not HTTP), when I open localhost in Chrome, I get a warning screen:

Your connection is not private

Attackers might be trying to steal your information from localhost (for example, passwords, messages or credit cards). Learn more NET::ERR_CERT_AUTHORITY_INVALID

You have to click "Advanced" then "Proceed to localhost (unsafe)". It gets annoying having to do this during development.

I generated a cert and key for localhost use according to the instructions for Node's http2 module. Is there any way to generate them in such a way that Chrome would actually accept them for localhost? Or is there another easy way to get rid of this warning?

(I'm aware of the option of launching Chrome with --ignore-certificate-errors but I'd prefer not to do this for all websites.)


Solution

  • Try the following:

    In Chrome, put in chrome://flags/#allow-insecure-localhost in the address bar.

    Enable the option that says "Allow invalid certificates for resources loaded from localhost".

    Restart Chrome, and it should allow the site.