ruby - 将 https 用于 ruby​​gems 时出现 SSL 连接问题

标签 ruby ssl

突然间,做完后只能安装gems

> gem sources --remove https://rubygems.org/
> gem sources --add http://rubygems.org/

源为 https,错误为 Error fetching https://rubygems.org/: SSL_connect returned=1 errno=0 state=error: 证书验证失败 (https://api.rubygems.org/specs.4.8.gz)

但是,我更新了我的证书,rvm osx-ssl-certs status all 返回了

Certificates for /opt/local/etc/openssl/cert.pem: Up to date.
Certificates for /etc/openssl/cert.pem: Up to date.
Certificates for /usr/local/etc/openssl/cert.pem: Up to date.

我在 OS X Yosemite 10.10.5、Ruby 2.3.0、RVM 1.29.0、openssl 1.0.11 上

最佳答案

for anyone else experiencing this, here is a solution that helped me

$ brew update && brew install openssl
$ cd /usr/local/etc/openssl/certs
$ curl -O http://curl.haxx.se/ca/cacert.pem
$ mv cacert.pem cert.pem
$ /usr/local/opt/openssl/bin/c_rehash

关于ruby - 将 https 用于 ruby​​gems 时出现 SSL 连接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42262513/

相关文章:

c++ - 为 C++ 选择嵌入式脚本语言

ruby - 从末尾开始每 3 个字符插入一个字符串

ruby - 从数组中移除重复的元素

c# - 使用 .Net Standard 2.0 库中的 x509 证书使用 WCF Web 服务?

ssl - 在 OpenSSL 中全局禁用协议(protocol)

ruby-on-rails - 查找集合的最后一条匹配记录

ruby - 嵌套模块命名空间? ruby

ssl - 如何从 OpenSSL 保存 LDAP SSL 证书

WCF transport security &&messags 安全模式问题

java - 如何解决 : jno_key_entry