新手问题 Secure Connection Failed

gengdejie · 2015年09月03日 · 最后由 gengdejie 回复于 2015年09月04日 · 4642 次阅读

I run 'rails server' locally in terminal, It starts Webrick normally on port 3000. Then I visit localhost:3000 in my brower firefox. An error occured:

title: Secure Connection Failed contents:
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)

The page you are trying to view cannot be shown because the authenticity of the received data could not be verified. Please contact the website owners to inform them of this problem.

PS:

Both in environments of development and production, this error displayed. Before this I configged the config/secrets.yml file. But I think the configuration is right. I don't know how to do , please help! Any answers are appreciated.

My OS is Ubuntu14x86 on virtual machine.

Maybe you give a screenshot will be help.

Have you tried to use ssl connection in the local? From the error message, it seems there is something wrong with your connection from the browser to the app server.

#2 楼 @chenge Good suggestion. And the screen shot is as follow:

#3 楼 @jackxu After many tests, I got four facts: 1.All conditions combination in production environment are failed. 2.The default port 3000 is disabled. 3.If I run 'rails server -e prouduction -p $PORT', then port '$PORT' will be disabled. Example:3001,3002... And the url 'http://xxx' typed in brower will be automatically redirected to 'https://xxx'. 4.All 'https://xxx' are failed.

do you set force_ssl true?

#8 楼 @gengdejie The default rails server -e prouduction -p $PORT start a webrick server that can not accept the ssl connection if you have not configured it with ssl process. You can have a try with this. By the way, it is not recommended to use ssl in the local environment.

#9 楼 @jackxu Thank you very much. I'll hava a try.

#9 楼 @jackxu I just got a message: WEBrick is not recommended to use in production environment. We should use Nginx or Apache as the server. From: http://guides.ruby-china.org/configuring.html Keyword: WEBrick.

需要 登录 后方可回复, 如果你还没有账号请 注册新账号