一直在尝试在 ubuntu 12.0.4 中使用 webrick 获得一个新的、刚刚创建的 Rails 应用程序来在 ssl 上工作。
已经尝试了我所知道的所有可能的方法。尝试使用config.force_ssl = true in 应用程序.rb, also 强制SSL in 应用控制器.
由于某些原因,当我在 Firefox 上使用 https:// loacalhost:3000 时,我收到一条错误消息:
###An error occurred during a connection to localhost:3000.###
###SSL received a record that exceeded the maximum permissible length.###
###(Error code: ssl_error_rx_record_too_long)###
在谷歌浏览器中,错误消息是,
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.
服务器日志显示,
[2012-07-22 16:26:04] ERROR bad URI `�D/i�b���\\��)�F6��ѡ���c���"�\e\x00\x00H\x00��'.
[2012-07-22 16:26:47] ERROR bad Request-Line `\x16\x03\x01\x00�\x01\x00\x00�\x03\x01P\v�onC��\x1D��\x16\x16R!NU�����\r'�\x05���
w��\x00\x00H\x00��'.
还尝试使用 webrick 和乘客在生产模式下运行应用程序。没有帮助。
看起来与未将公钥传递给客户端有关。但我可能是错的。
您在开发模式下使用的服务器似乎没有向客户端提供 ssl 证书。
出于开发目的,您可以使用“Thin”,因为如果您使用以下命令启动服务器,它会提供 ssl 证书:
“精简启动--ssl”
而不是通常的:
“rails s/rails 服务器”
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)