SSL连接问题使用HTTPS时的RubyGems

问题描述:

突然之间,我只能做SSL连接问题使用HTTPS时的RubyGems

> 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: certificate verify failed (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,红宝石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