SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed on Mac

匿名 (未验证) 提交于 2019-12-03 03:10:03

问题:

Using Homebrew, on Mac OSX 10.7.5

 $ brew install openssl Error: openssl-1.0.1e already installed  $ rake test.rake rake aborted! SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed 

I acknowledge that there are other questions like the one in title, but none of the solution seems to work. I have tried those at various points, with no success:

 rvm pkg install openssl rvm reinstall 1.9.3 --with-openssl-dir=$rvm_path/usr 
 rvm remove 1.9.3 brew install openssl rvm install 1.9.3 --with-openssl-dir=`brew --prefix openssl` 

I decided to check openssl version and noticed this:

 $ openssl version OpenSSL 0.9.8r 8 Feb 2011 

Hopefully that is indeed the problem and the fix is as simple as making sure my laptop detects the correct OpenSSL.

But how do I fix this, so I have it use Homebrew's newer OpenSSL instead?

Thanks in advance.

回答1:

You need to update certificates:

sudo curl http://curl.haxx.se/ca/cacert.pem -o "$(ruby -ropenssl -e "p OpenSSL::X509::DEFAULT_CERT_FILE")" 

Although this is considered to be not safe as the certificates are downloaded without https and there is no way to tell if they were not changed on the way.

RVM has updated code that will use OSX certificates to update the file and will pull automatically dependencies, you can get it with:

rvm get head rvm install 1.9.3 


回答2:

it worked for me using rvm

$ rvm osx-ssl-certs status all $ rvm osx-ssl-certs update all 


回答3:

Building on mpapis's answer, I executed these commands that fixed the problem for me.

$ cd ~ $ rvm get head $ rvm requirements 

This gave me two key pieces of feedback:

Upgrade of RVM in /Users/myuser/.rvm/ is complete. RVM Reloaded! 

and

Installing requirements for osx, might require sudo password. Updating certificates in '/usr/local/etc/openssl/cert.pem'. 

After that, I didn't get the error anymore.



回答4:

on my mac running 10.8.3 i had this problem too, however i had a problem with the above solution because when i tried to do rvm get head install 1.9.3

or

rvm requirements  

i got Error running 'requirements_osx_brew_libs_install... which is a nightmare in its own right see Error running 'requirements_osx_brew_libs_install...' on Mac 10.7 for proof

anyway i got it working by doing

wget http://curl.haxx.se/ca/cacert.pem >  mv cacert.pem /Users/USER/.rvm/usr/ssl/cert.pem 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!