Chrome会将.dev重定向到https

时间:2017-12-12 08:38:38

标签: laravel google-chrome ssl https laragon

Google Chrome突然将我的虚拟主机域myapplication.dev重定向到https://myapplication.dev。我已经尝试去

  

铬://净内部/#HSTS

并将myapplication.dev输入到最底部的文本框中"删除域安全策略"但这没有效果。

我也试图删除浏览器数据。

我还做的是将v-host更改为.app而不是.dev,但Chrome仍然将我重定向到https:// ...

它是在Laragon上运行的Laravel应用程序。 在同一网络中的其他PC上,它运行良好。

7 个答案:

答案 0 :(得分:34)

无法在var unsavedData = "Going back will log you out, and lose your information. Are you sure you want to do this?"; window.onpopstate = function askConfirm() { if (needToConfirm) return unsavedData; } 域名上使用https阻止Chrome(> = 63)表单。
谷歌现在拥有官方.dev tld,并已声明他们不会删除此功能。

建议使用其他tld进行开发,例如.dev.localhost

有关此更新的详细信息,请参阅this article by Mattias Geniar

答案 1 :(得分:5)

检查该链接

https://laravel-news.com/chrome-63-now-forces-dev-domains-https

根据Danny Wahl撰写的这篇文章,他建议您使用以下其中一项:“。localhost”,“。invalid”,“。test”或“.example”。

答案 2 :(得分:4)

值得注意的是,还有其他TLD被迫https:https://chromium.googlesource.com/chromium/src.git/+/63.0.3239.118/net/http/transport_security_state_static.json#262

现在

googledevfoopageappchrome

答案 3 :(得分:3)

Chrome 63通过预加载的HSTS强制.dev域到HTTPS 很快所有其他浏览器都会关注。

.dev gTLD已被Google收购以供内部使用,不能再用于http,只允许使用https。有关进一步说明,请参阅此文章:

https://ma.ttias.be/chrome-force-dev-domains-https-via-preloaded-hsts/

答案 4 :(得分:3)

MacOS Sierra,Apache :在Chrome 63强制通过预装的HSTS phpmyadmin在我的mac停止工作后强制.dev顶级域名到HTTPS。我看了this,只想编辑/etc/apache2/extra/http-vhosts.conf文件:

<VirtualHost *:80>
  DocumentRoot "/Users/.../phpMyAdmin-x.y.z"
  ServerName phpmyadmin.localhost
</VirtualHost>

并重启apache(sudo /usr/sbin/apachectl stop; sudo /usr/sbin/apachectl start) - 现在它适用于 http://phpmyadmin.localhost :)。对于laravel应用,解决方案类似。

好的一点是,在设置新项目时使用*.localhost顶级域名,您可以忘记编辑/etc/hosts

那有多酷? :)

  

add the .localhost domain as a new standard还有一个很好的提案,在这里更合适。

2018年更新

使用*.localhost并不好 - 有些应用程序不支持它像cURL(由php-guzzle使用) - 更多细节here。更好的是使用*.local

答案 5 :(得分:1)

这个问题无法解决。以下是原因:

  1. Google拥有.dev gTLD
  2. Chrome会在源代码中直接强制.dev域上的HTTP到HTTPS。
  3. 从下面的第二个链接:

    ...
    // eTLDs
    // At the moment, this only includes Google-owned gTLDs,
    // but other gTLDs and eTLDs are welcome to preload if they are interested.
    { "name": "google", "include_subdomains": true, "mode": "force-https", "pins": "google" },
    { "name": "dev", "include_subdomains": true, "mode": "force-https" },
    { "name": "foo", "include_subdomains": true, "mode": "force-https" },
    { "name": "page", "include_subdomains": true, "mode": "force-https" },
    { "name": "app", "include_subdomains": true, "mode": "force-https" },
    { "name": "chrome", "include_subdomains": true, "mode": "force-https" },
    ...
    

    参考

答案 6 :(得分:1)

对于Firefox: 您可以访问地址 about:config ,停用 network.stricttransportsecurity.preloadlist 属性。

对于IE,它似乎仍在工作。

对于Chrome,没有解决方案,我认为它在源代码中是硬编码的。

查看该文章:How to prevent Firefox and Chrome from forcing dev and foo domains to use https