18

I accidently configured a web-app to force a secure connection i.e. https, and although I have turned this off, I cannot get chrome to forget this error, so whenever I ask for the url of my local development server;

 http://localhost:3000/

Chrome instead returns

https://localhost:3000/

and gives the error

This site can’t provide a secure connection

I have tried Chrome/Clear Browsing data and this does not help. The app uses ruby on rails and the secure connection was done by setting config.force_ssl = true.

How do I fix this?

4
  • 2
    Out of curiosity, does the same thing happen when using a different browser (e.g. Firefox, Safari)? I'm asking to see if it's an issue with Chrome or perhaps http/https redirection on the app Commented Dec 28, 2016 at 22:42
  • Exactly how did you configure your app to force a secure connection? Did you use a HTTP redirect? - If so, was it 301, 307, or? - Or did you use HSTS to force a secure connection? If so, with which parameters? - The answers to these questions are necessary in order to determine what you need to do to solve your problem.
    – jksoegaard
    Commented Dec 28, 2016 at 22:52
  • It is a ruby on rails app, and I put in the configuration file ``` config.force_ssl = true```. if you look here, stackoverflow.com/a/39476254/1299362, you can see that it does quite a lot. I can see why jsoegaard asked how it was configured, quite a lot happens. I will edit the question to include this information.
    – Obromios
    Commented Dec 30, 2016 at 4:26
  • Dials Mavis, it affects Firefox and Safari, but just resetting the cache fixes it for those browsers.
    – Obromios
    Commented Dec 30, 2016 at 4:26

4 Answers 4

22

As this is only your development site on localhost, and not a real domain name, you can solve the problem in Chrome by opening the following URL:

chrome://net-internals/#hsts

You must open this URL in Chrome.

From there you get the settings for HSTS (HTTP Strict Transport Security). Then under "Delete domain" put in localhost and delete it from the list.

If you have used other local names than localhost to refer to your development setup, delete those as well.

3
  • 3
    Tried deleting localhost, localhost:3000, 0.0.0.0, 0.0.0.0:3000, 127.0.0.1, 127.0.0.1:3000, all to no avail.
    – Obromios
    Commented Jan 2, 2017 at 2:21
  • 2
    deleting localhost and also clearing chrome://history/ did it for me Commented Apr 13, 2017 at 16:24
  • great solution!
    – saulyasar
    Commented Mar 21, 2022 at 8:14
11

I always find adding a fake query string after the URL refreshes the cache for me.

e.g. http://localhost:3000/?fake=true

1
  • Can't believe ^this^ worked when clearing cache did not. Port 8080 was blocked by chrome for me. Madness. Thanks @Tobe_Sta Commented Aug 7 at 10:58
3

For me the solution was to use http rather than https

1
  • Tried that but chrome auto-redirects to httpS. Tobe_sta's answer worked for me. Commented Aug 7 at 11:20
1

I ended up going for the nuclear option, uninstalling chrome and using this post to delete all my google-chrome data. It worked. Note that just uninstalling chrome did not work.

You must log in to answer this question.

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