简体   繁体   English

Rails Hartl教程:每次进入页面激活新用户时都会出现SSL错误

[英]Rails Hartl Tutorial: Getting an SSL error every time I go to the page to activate a new user

I'm following along Michael Hartl's Rails tutorial, and I've seem to hit a wall in Chapter 11 Link to relevant section. 我正在跟随Michael Hartl的Rails教程,我似乎在第11章链接到相关部分。 I'm running this from my own computer, so I'm visiting localhost:3000. 我是从自己的电脑上运行的,所以我正在访问localhost:3000。 I create a new user via the signup page in the app, and I can check the rails server logs to see the email that is generated with the link for activation. 我通过应用程序中的注册页面创建了一个新用户,我可以检查rails服务器日志,以查看通过激活链接生成的电子邮件。 However, when I follow the link I get an error in chrome (and other browsers as well) saying: 但是,当我按照链接时,我在chrome(以及其他浏览器)中出现错误:

This site can't provide a secure connection 此站点无法提供安全连接

localhost sent an invalid response. localhost发送了无效的响应。

Try running Windows Network Diagnostics. 尝试运行Windows网络诊断程序。

ERR_SSL_PROTOCOL_ERROR ERR_SSL_PROTOCOL_ERROR

My server logs state: 我的服务器记录状态:

2017-06-01 21:03:21 -0400: HTTP parse error, malformed request (): #
<Puma::HttpParserError: Invalid HTTP format, parsing fails.>
2017-06-01 21:03:21 -0400: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:
<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, 
"rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", 
"SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"puma 3.4.0 Owl Bowl 
Brawl", "GATEWAY_INTERFACE"=>"CGI/1.2"}

I've tried turning off my firewall, resetting my cache and cookies, and other solutions I found on the web, but nothing seems to do the trick. 我试过关闭我的防火墙,重置我的缓存和cookie,以及我在网上找到的其他解决方案,但似乎没有什么可以做到的。 I know common practice is to give relevant snippets of application code, but I honestly don't even know where to begin with that. 我知道通常的做法是提供相关的应用程序代码片段,但老实说,我甚至不知道从哪里开始。 If there's any files you need to see, then I'll be happy to post them. 如果您需要查看任何文件,那么我很乐意发布它们。 Thanks. 谢谢。

I ran into the same Problem and it took me some time to solve it. 我遇到了同样的问题,我花了一些时间来解决它。 Probably You solved it by now. 可能你现在已经解决了。 So to save others the time finding the solution, I just want to share it here. 因此,为了节省其他人找到解决方案的时间,我只想在这里分享。 The solution is to just hit localhost:3000 without the https:// This way there is now ssl decryption/parsing involved, which is not necessary in development and will only cause a parsing error. 解决方案是在没有https://的情况下点击localhost:3000这种方式现在涉及ssl解密/解析,这在开发中不是必需的,只会导致解析错误。

Best Sebastian 最好的塞巴斯蒂安

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM