bryan
bryan

Reputation: 9389

Safari is forcing HTTPS on everything when I don't want it to

On my localhost development environment, when I manually browse to http://localhost it automatically redirects me to https every time.

And I get this error: enter image description here

When I do the same in chrome, it successfully goes to http.

Is there anyway I can mitigate this or to get https to work on my local dev servers? Any help would be greatly appreciated because until I fix it I can't use safari.

Upvotes: 1

Views: 5556

Answers (1)

jeffbyrnes
jeffbyrnes

Reputation: 2221

The answer to this is the same as this answer for this Ask Different answer by @Johnathan Elmore:

HSTS Policy is now included in Safari's stored website data, and you can remove localhost data to clear this issue.

  1. command + ,
  2. Privacy -> Manage Website Data...
  3. Search localhost
  4. Click Remove

Change https://localhost to http://localhost in your address bar and click return key.

The trick here is that, at some point, you visited a localhost with an HSTS policy, which means that it will never attempt to visit the HTTP version. This is a great security feature for websites generally, but problematic for local development.

Upvotes: 2

Related Questions