82

I know that my SSL certificate for localhost is not valid. I know my connection isn't actually secure. I don't care! I'm talking to my own machine.

How can I tell Chrome to ignore certificate errors on localhost?

enter image description here

7
  • 4
    Simplest way just place the certificate into the oeprating system's Certificate Store. This way the certificate WILL BE trusted by your operating system. If you use Firefox you have to setup Firefox to also trust the certificate since Firefox uses it own certificate store not the host operating systems certificate store. Having no luck finding a question that does a good job of explaining how to do this at this time.
    – Ramhound
    Jun 24, 2014 at 12:35
  • 2
    @Ramhound Adding the certificate to my certificate store has no impact on the issue because the certificate does not match the URL no matter how hard I trust it. So, yeah, I could issue myself a different certificate, add it to the store and use that in the application. But I hope that is not the only to get around this warning and that wasn't my question anyway. Jun 24, 2014 at 12:50
  • 1
    Simply stated you can't tell Chrome to ignore certificate errors on just localhost. You can tell Chrome to ignore all certificate errors but that would be extremely unwise.
    – Ramhound
    Jun 24, 2014 at 12:54
  • 2
    Your connection is actually secure though. Unless your computer has spyware or something I guess—but then your connection wouldn't be secure even where Chrome says it is.
    – Sparkette
    May 2, 2019 at 4:04
  • 1
    You can also use a non-SSL connection, but get Chrome to treat the connection as secure using chrome://flags/#unsafely-treat-insecure-origin-as-secure
    – Piran
    Jun 16, 2022 at 14:23

1 Answer 1

116

There is now a flag for this at chrome://flags/#allow-insecure-localhost.

enter image description here

We've used this for a while, but have since moved to using a proper certificate that is issued to a subdomain we own. That subdomain has an A record that points to 127.0.0.1 and a AAAA that points to ::1.

However, Chrome seems to have an issue with that DNS setup and randomly throws DNS related errors. So you'd want to add the mapping manually to the hosts file as well.

That's what we do right now and it works great.

4
  • 1
    Don't forget to restart your browser for the flag to take effect!
    – Bugs Bunny
    Jul 28, 2020 at 23:09
  • This also works on Edge
    – NotAPro
    Feb 25, 2021 at 7:46
  • This seems to have vanished :-(
    – Grim...
    Nov 24, 2023 at 11:52
  • Sad. Just get a certificate for localhost.example.com then and point that record to 127.0.0.1. Works everywhere. Nov 25, 2023 at 9:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .