6

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 – Dials Mavis Dec 28 '16 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 Dec 28 '16 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 Dec 30 '16 at 4:26
  • Dials Mavis, it affects Firefox and Safari, but just resetting the cache fixes it for those browsers. – Obromios Dec 30 '16 at 4:26
8

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.

2
  • 1
    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 Jan 2 '17 at 2:21
  • deleting localhost and also clearing chrome://history/ did it for me – Chad Hedgcock Apr 13 '17 at 16:24
8

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

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

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.

0

For me the solution was to use http rather than https

You must log in to answer this question.

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