将chrome升级到chrome 73后,SSL证书在本地的rails中不起作用。直到chrome 70和最新版本的safari都可以正常工作。使用此链接在本地https://gist.github.com/jed/6147872上设置ssl证书
导轨5.2.2.1 Ruby 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>
答案 0 :(得分:1)
我在Rails 5.2.3和ruby 2.6.3p62,puma 3.12.4上遇到了相同的错误。我试图按照this link中的说明在开发环境中使用自签名SSL证书。我使用以下命令生成了密钥和证书:
openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt
,然后使用以下命令启动服务器(在我的情况下为puma):
rails s -b 'ssl://localhost:3000?key=localhost.key&cert=localhost.crt'
但我收到此错误:
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>
我在this puma issue中找到了解决方法。我卸载了当前的puma gem:
gem uninstall puma
并替换为我的gemfile:
gem 'puma', '~> 4.3' #'~> 3.11'
#gem 'puma', git: 'https://github.com/eric-norcross/puma.git', branch: 'chrome_70_ssl_curve_compatiblity'
最终
bundle install
,它开始起作用。来自github的经评论的puma gem也可以使用,但是给了我SSL上的websockets问题。
答案 1 :(得分:0)
在这种情况下,请尝试使用下面的gem代替Pumagem
'puma', git: 'https://github.com/eric-norcross/puma.git', branch: 'chrome_70_ssl_curve_compatiblity'
这可以解决我的问题