Sid*_*ant 4 ssl google-chrome ruby-on-rails localhost
将 chrome 升级到 chrome 73 后,SSL 证书在 rails local 中不起作用。它一直工作正常,直到 chrome 70 和最新版本的 safari。使用此链接在本地https://gist.github.com/jed/6147872上设置 ssl 证书
轨道 5.2.2.1 红宝石 2.6.1
chrome 73 上的错误是:
2019-04-22 13:34:07 +0530: SSL error, peer: 127.0.0.1, peer cert: , #<Puma::MiniSSL::SSLError: OpenSSL error: error:141F7065:SSL routines:final_key_share:no suitable key share - 337604709>
Run Code Online (Sandbox Code Playgroud)
我在 Rails 5.2.3 和 ruby 2.6.3p62、puma 3.12.4 上也有同样的错误。我试图按照此链接中的说明在我的开发环境中使用自签名 SSL 证书。我生成了密钥和证书:
openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt
Run Code Online (Sandbox Code Playgroud)
然后使用以下命令启动服务器(在我的情况下为 puma):
rails s -b 'ssl://localhost:3000?key=localhost.key&cert=localhost.crt'
Run Code Online (Sandbox Code Playgroud)
但我收到了这个错误:
SSL error, peer: 172.23.0.1, peer cert: , #<Puma::MiniSSL::SSLError: OpenSSL error: error:141F7065:SSL routines:final_key_share:no suitable key share - 337604709>
Run Code Online (Sandbox Code Playgroud)
我在这个 puma issue 中找到了一个解决方法。我卸载了当前的 puma gem:
gem uninstall puma
Run Code Online (Sandbox Code Playgroud)
并在我的 gemfile 中替换:
gem 'puma', '~> 4.3' #'~> 3.11'
#gem 'puma', git: 'https://github.com/eric-norcross/puma.git', branch: 'chrome_70_ssl_curve_compatiblity'
Run Code Online (Sandbox Code Playgroud)
最后
bundle install
Run Code Online (Sandbox Code Playgroud)
它开始起作用了。来自 github 的评论 puma gem 也有效,但给我带来了 websockets over ssl 的问题。
| 归档时间: |
|
| 查看次数: |
1810 次 |
| 最近记录: |