ERROR错误请求行 - 强制ssl - rails

Ben*_*mir 14 ssl configuration ruby-on-rails-3

我偶然将force_ssl设置为true,然后当恢复为false并运行服务器时,我收到以下错误:

ERROR bad Request-Line 

WEBrick 1.3.1
INFO  ruby 1.9.3 (2012-02-16) [x86_64-darwin11.4.0]
WEBrick::HTTPServer#start: pid=472 port=3000
ERROR bad Request-Line `\x16\x03\x01\x00?\x01\x00\x00?\x03\x02P?Mf\x00??C?'.
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?

当我在本地主机上点击http url时,它会重定向到https并给我这个错误:

SSL connection error
Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have.
Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.
Run Code Online (Sandbox Code Playgroud)

Ben*_*mir 13

答案可以在这里找到:如何使用停用Webrick的SSL

您可以通过清除浏览器cookie来修复它,然后再次运行.似乎身份验证信息保存在cookie中并不断将我们的请求恢复为HTTPS,但未正确进行身份验证,因此您会收到该错误.


p.m*_*los 6

也许你可以试试:

1)rake tmp:clear在命令行上停止 Rails 服务器 2)

然后重新开始,看看问题是否仍然存在。

更新:也许您也可以尝试清除浏览器上的任何缓存内容/历史记录内容。