MAK*_*MAK 7 openssl ruby-on-rails ssl-certificate puma
每次我尝试连接到服务器时,Rails 服务器都会抛出 SSL 错误。
[34087] Puma starting in cluster mode...
[34087] * Version 4.3.3 (ruby 2.6.5-p114), codename: Mysterious Traveller
[34087] * Min threads: 10, max threads: 10
[34087] * Environment: development
[34087] * Process workers: 1
[34087] * Phased restart available
[34087] * Listening on tcp://0.0.0.0:3001
[34087] * Listening on ssl://0.0.0.0:3000?cert=config/ssl.crt&key=config/ssl.key&verify_mode=none&no_tlsv1=false&no_tlsv1_1=false
[34087] Use Ctrl-C to stop
[34087] * Starting control server on unix:///tmp/puma-status-1596893456509-34087
[34087] - Worker 0 (pid: 34120) booted, phase: 0
2020-08-08 19:03:16 +0530: SSL error, peer: 127.0.0.1, peer cert: , #<Puma::MiniSSL::SSLError: OpenSSL error: error:14209102:SSL routines:tls_early_post_process_client_hello:unsupported protocol - 337678594>
Run Code Online (Sandbox Code Playgroud)
ssl 证书和密钥已从 Rails 服务器中的配置中提供,但即便如此,我仍然收到 ssl 错误
Osk*_*ins -1
只需将我的应用程序设置为在本地开发环境中使用 SSL 运行即可。我采取的步骤:
$ openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt
$ rails s -b 'ssl://localhost:3000?key=localhost.key&cert=localhost.crt'
也许这可以帮助你。在您的情况下,您可能可以省略第一步,只需使用您的,文件rails s的正确路径编辑步骤 2 中的命令。localhost.keylocalhost.crt
还可以提到,在我的config/environemnts/development.rb文件末尾添加了:
config.force_ssl = true
但不确定是否有必要。
| 归档时间: |
|
| 查看次数: |
2009 次 |
| 最近记录: |