SSL_connect返回=1 errno=0状态=SSLv3读取服务器证书B:证书验证在Mac上失败。

时间:2021-11-24 00:28:41

Using Homebrew, on Mac OSX 10.7.5

在Mac OSX 10.7.5上使用Homebrew。

$ 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的版本,并注意到:

$ 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.

希望这确实是一个问题,解决方法就像确保我的笔记本电脑检测到正确的OpenSSL一样简单。

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

但是我该如何解决这个问题呢?所以我要用Homebrew的新OpenSSL来代替它?

Thanks in advance.

提前谢谢。

4 个解决方案

#1


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.

尽管这被认为是不安全的,因为证书在没有https的情况下被下载,而且没有办法判断它们是否在途中发生了变化。

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

RVM已经更新了将使用OSX证书更新文件的代码,并将自动提取依赖项,您可以使用:

rvm get head
rvm install 1.9.3

#2


15  

it worked for me using rvm

使用rvm对我有用。

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

#3


3  

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

在mpapis的回答上,我执行了这些命令来解决我的问题。

$ 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


0  

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

在我的mac上运行10.8.3我也有这个问题,但是我有一个上面的解决方案的问题,因为当我尝试做rvm的时候,我的头安装了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

运行“requirements_osx_brew_libs_install…”它本身就是一场噩梦,运行“requirements_osx_brew_libs_install…”“在Mac 10.7上证明。”

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

#1


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.

尽管这被认为是不安全的,因为证书在没有https的情况下被下载,而且没有办法判断它们是否在途中发生了变化。

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

RVM已经更新了将使用OSX证书更新文件的代码,并将自动提取依赖项,您可以使用:

rvm get head
rvm install 1.9.3

#2


15  

it worked for me using rvm

使用rvm对我有用。

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

#3


3  

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

在mpapis的回答上,我执行了这些命令来解决我的问题。

$ 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


0  

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

在我的mac上运行10.8.3我也有这个问题,但是我有一个上面的解决方案的问题,因为当我尝试做rvm的时候,我的头安装了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

运行“requirements_osx_brew_libs_install…”它本身就是一场噩梦,运行“requirements_osx_brew_libs_install…”“在Mac 10.7上证明。”

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