0

I know this error has been posted/answered everywhere but I can't find anything to solve my issue. so here is the detailed situation.

my specs are the following:

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

I have 2 tests to see if my certs are working as expected.

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

I have 2 solutions to update my certificates, but none on them pass the 2 tests. See:

##
## 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

I can't make both of my curl tests to work.
I must have misunderstood something. But I can't figure out what.

Micka
  • 1,648
  • 1
  • 19
  • 34

0 Answers0