【问题标题】:Getting ERR_INSECURE_RESPONSE error before redirecting to ssl page在重定向到 ssl 页面之前出现 ERR_INSECURE_RESPONSE 错误
【发布时间】:2015-08-11 09:29:17
【问题描述】:

我在 Heroku 上有一个使用 Expedited SSL 的 Rails 应用程序(以防万一)。

现在我可以从 example.com 永久转发到 https://www.example.com。偶尔,我只在 Chrome 上注意到它,当我请求页面 http://example.com 时,我收到一个 ERR_INSECURE_RESPONSE 错误页面,然后几秒钟后,它会将我带到 https://www.example.com 页面并正常加载。

我在控制台中运行了检查器以查看 http 不安全警告,但什么也没有。我尝试了几次卷曲,有一次出现错误。

Bashar:example bashar$ curl -v http://example.com
* Rebuilt URL to: http://example.com/
* Hostname was NOT found in DNS cache
*   Trying xx.xx.xx.xx...
* Connected to example.com (xx.xx.xx.xx) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.37.0
> Host: example.com
> Accept: */*
> 
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
Bashar:example bashar$ curl -v http://example.com
* Rebuilt URL to: http://example.com/
* Hostname was NOT found in DNS cache
*   Trying xx.xx.xx.xx...
* Connected to example.com (xx.xx.xx.xx) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.37.0
> Host: example.com
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Cache-Control: max-age=900
< Content-Type: text/html
< Location: https://www.example.com
* Server Microsoft-IIS/7.5 is not blacklisted
< Server: Microsoft-IIS/7.5
< X-AspNet-Version: 4.0.30319
< X-Powered-By: ASP.NET
< Date: Tue, 11 Aug 2015 09:15:46 GMT
< Content-Length: 0
< Age: 1
< Connection: keep-alive
< 
* Connection #0 to host example.com left intact

我已经阅读了有关该主题的多个讨论,但没有找到与此完全相同的讨论。有什么想法吗?

【问题讨论】:

    标签: ruby-on-rails ssl heroku


    【解决方案1】:

    我不确定是否有其他或更好的解决方案。但是我找到了 Brian Heroku SSL on root domain 的这个答案 从 GoDaddy 迁移到 DNSimple 来解决问题。再也看不到问题了,甚至更好的是,该站点可以使用和不使用 www,以及使用 http 和 https。好像没有

    【讨论】:

      猜你喜欢
      • 2016-05-19
      • 1970-01-01
      • 2010-12-16
      • 1970-01-01
      • 2012-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-13
      相关资源
      最近更新 更多