我知道这个错误到处都是posted/answered,但我无法找到解决问题的方法。所以这里是详细的情况。
我的规格如下:
Mac OS X 10.10.5
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
OpenSSL 1.0.2d 9 Jul 2015
curl 7.43.0 (x86_64-apple-darwin14.0) libcurl/7.43.0 SecureTransport zlib/1.2.5
我有2个测试,看看我的证书是否按预期工作。
curl -I https://encrypted.google.com
# Failure => curl: (51) SSL: certificate verification failed (result: 5)
# Success => HTTP/1.1 200 OK
curl -I https://s3.amazonaws.com/skylight-agent-packages/skylight-native/0.7.0-9075c90/skylight_x86_64-darwin.tar.gz
# Failure => curl: (51) SSL: certificate verification failed (result: 5)
# Success => HTTP/1.1 200 OK
我有2个解决方案来更新我的证书,但没有一个通过2个测试。参见:
##
## First solution
## Using curl.haxx.se/ca/cacert.pem
##
# First I delete all my certs
sudo rm -f /usr/local/etc/openssl/cert.pem
sudo rm -f /etc/openssl/certs/cacert.pem
sudo rm -f /etc/openssl/certs/cert.pem
sudo rm -f /etc/openssl/cert.pem
# Then I download the cert from haxx
cd /etc/openssl && sudo wget http://curl.haxx.se/ca/cacert.pem -O cert.pem && sudo chown mickael:staff cert.pem
# Finally, I link it everywhere
sudo ln -s /etc/openssl/cert.pem /etc/openssl/certs/cert.pem
sudo ln -s /etc/openssl/cert.pem /etc/openssl/certs/cacert.pem
sudo ln -s /etc/openssl/certs/cacert.pem /usr/local/etc/openssl/cert.pem
#
# Results
#
curl -I https://encrypted.google.com #=> Success
curl -I https://s3.amazonaws.com/skylight-agent-packages/skylight-native/0.7.0-9075c90/skylight_x86_64-darwin.tar.gz #=> Failure
##
## Second solution
## Using rvm
##
rvm osx-ssl-certs update all
#
# Results
#
curl -I https://encrypted.google.com #=> Failure
curl -I https://s3.amazonaws.com/skylight-agent-packages/skylight-native/0.7.0-9075c90/skylight_x86_64-darwin.tar.gz #=> Success
我不能让我的两个卷曲测试都起作用 我一定是误解了一些东西。但我无法弄清楚是什么。