升级到 Chrome 73 后,SSL 证书在本地 Rails 上不起作用

Posted

技术标签:

【中文标题】升级到 Chrome 73 后,SSL 证书在本地 Rails 上不起作用【英文标题】:SSL certificate not working on rails local after upgrading to Chrome 73 【发布时间】:2019-09-11 09:29:33 【问题描述】:

将 chrome 升级到 chrome 73 后,SSL 证书在本地 Rails 中无法正常工作。在 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>

【问题讨论】:

如果可能,请提供更多详细信息和日志 证书在 Chrome 73 上通用。证书在 Rails 上通用。这意味着您的设置有一些特别之处,但从提供的一些细节中不清楚是什么 - 这使得问题过于宽泛。我建议您 a) 再次检查它是否适用于不同版本的 Chrome 和其他浏览器 b) 检查 SSLLabs 并确保服务器配置至少在 A 中为您提供,因为其他所有内容都可能指向配置你的服务器有问题。 已更新日志@DeepakMahakale 【参考方案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 也有效,但给了我使用 websockets over ssl 的问题。

【讨论】:

测试了很多方法,终于成功了!谢谢。 你可能不得不使用bundle update puma 而不是bundle install【参考方案2】:

在这种情况下,请尝试使用下面的 gem 而不是 Pumagem

'puma', git: 'https://github.com/eric-norcross/puma.git', branch: 'chrome_70_ssl_curve_compatiblity'

这可以解决我的问题

【讨论】:

以上是关于升级到 Chrome 73 后,SSL 证书在本地 Rails 上不起作用的主要内容,如果未能解决你的问题,请参考以下文章

Chrome 都对无记录“SSL证书”弹警告了!你的网站竟连HTTPS都没升级

《谷歌宣布Chrome不再信任所有赛门铁克SSL证书》误读新闻的澄清说明

如何在 Chrome 信任的本地 Windows 虚拟主机开发机器上创建/安装自签名 SSL 证书? [复制]

作曲者:SSL证书问题:无法获取本地颁发者证书

创建Octopus包时出现SSL证书错误

DV SSL证书可以升级到OV SSL证书吗?