Skip to content →

Localhost SSL traffic fails with ERR_CONNECTION_CLOSED in Chrome

Chrome by default rejects all localhost traffic if it has an invalid SSL certificate. This invalid certificate may be due to not trusting the Charles SSL certificate, or it may be because the SSL certificate your localhost server is using has expired or has the wrong name.

Check the connection, and your certificate, in another browser, as other browsers are not so stringent.

If this is the issue, we recommend fixing the issue with your certificate—such as renewing it or adding the correct common name to the certificate.

You can also change the setting in Chrome, so it no longer rejects these certificates outright. Do this by going to chrome://flags/#allow-insecure-localhost and enabling Allow invalid certificates for resources loaded from localhost.