How to stop Chrome from redirecting to HTTPS?

2019-01-05 04:02发布

A few days ago, Chrome started redirecting all of my vHosts in Wampserver to https. Everything was working fine until a couple days ago, then one day I logged on to work on my site and Chrome said that the site couldn't be reached, even though I used the same URL i always did in the past. Wamp is running as well as Apache and MySQL and none of those services have any errors in the error log.

I have already tried removing the domain(I use a fake .dev extension for my local sites) with chrome://net-internals/#hsts but that didn't do anything. I also tried installing SSL to see if Chrome would detect it as a secure connection... nothing. I even tried reinstalling Wamp completely(even though the vHosts work fine in other browsers) and nothing changed.

The only thing that works in Chrome is accessing the sites via http://localhost/site. The redirect to HTTPS happens for all of my Apache vHosts. I've googled and googled and can't find anything that actually fixes the problem.

4条回答
Viruses.
2楼-- · 2019-01-05 04:12

I can't improve the answer of @benedikt, as it is correct. There are good temporary fixes:

  • typing "badidea" on the warning page, this might not work if you have SSL set up (hacked together) locally. It bypasses the warning, but my local SSL isn't setup correctly and shows another local site.
  • narayon also suggests a link to a chrome forum, which I haven't tried.

My workaround was to update all my ".dev" development TLDs to ".d3v" Still short enough to type quickly, descriptive, and probably future-proof.

查看更多
beautiful°
3楼-- · 2019-01-05 04:25

I have found a quick work-around that worked for my needs and may help someone else.

I use Browser Sync when developing and I just set the proxy argument to "testsite.dev" and it will serve up correctly in Chrome.

Here is the command I am using:

browser-sync start --proxy "testsite.dev" --port "3000" --files "./**/*.*"
查看更多
做自己的国王
4楼-- · 2019-01-05 04:29

I too use the .dev extension and will change to some other domain in the future but for my existing .dev sites, when the privacy error shows up, click anywhere on the screen and type 'badidea' and chrome will redirect you to the site. It works!

查看更多
放荡不羁爱自由
5楼-- · 2019-01-05 04:34

Chrome v63 forces .dev domains to HTTPS. The Internet Engineering Task Force RFC2606 specified what top level domains should be used for local development, and .dev isn't on that list.

Google owns the .dev top level domain and automatically redirects all .dev domain names to an HTTPs version of the site via preloaded HSTS.

With .dev being an official generic top-level domain (gTLD), we're better changing our local development suffix from .dev to something else, even if there are other solutions (e.g. https with self-signed certificates). So you should use .test, .example, .invalid or .localhost as your local development TLDs instead.

查看更多
登录 后发表回答