我使用Authlogic-Connect第三方登录。在运行适当的迁移后,Twitter/谷歌/yahoo登录似乎工作正常,但facebook登录抛出异常:

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

开发日志显示

OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed):
  app/controllers/users_controller.rb:37:in `update'

请建议. .


当前回答

对我来说,有效的答案是:

# Reinstall OpenSSL
brew update
brew remove openssl
brew install openssl
# Download CURL CA bundle
cd /usr/local/etc/openssl/certs
wget http://curl.haxx.se/ca/cacert.pem
/usr/local/opt/openssl/bin/c_rehash
# Reinstall Ruby from source
rvm reinstall 2.2.3 --disable-binary

其他回答

我遇到了这个问题,rvm OSX -ssl-certs更新的建议修复都不起作用,尽管我是OSX上的rvm用户。

对我来说有效的修复方法是重新安装最新版本的openssl:

brew update
brew remove openssl
brew install openssl

对我来说,有效的答案是:

# Reinstall OpenSSL
brew update
brew remove openssl
brew install openssl
# Download CURL CA bundle
cd /usr/local/etc/openssl/certs
wget http://curl.haxx.se/ca/cacert.pem
/usr/local/opt/openssl/bin/c_rehash
# Reinstall Ruby from source
rvm reinstall 2.2.3 --disable-binary

我试着用brew安装curl-ca-bundle,但这个包已经没有可用的了:

$ brew install curl-ca-bundle
Error: No available formula for curl-ca-bundle 
Searching formulae...
Searching taps...

对我来说,Mac上的解决方案是:

 $ cd /usr/local/etc/openssl/certs/
 $ sudo curl -O http://curl.haxx.se/ca/cacert.pem

在~/中添加这一行。Bash_profile(或~/.)ZSHRC for zsh):

export SSL_CERT_FILE=/usr/local/etc/openssl/certs/cacert.pem

然后更新你的终端:

$ source ~/.bash_profile

我不得不重新安装Ruby。如果你使用Ubuntu & rbenv,这应该可以解决这个问题:

rbenv uninstall your_version

# install dependencies
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev

# install ruby with patch
curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt | \
  rbenv install --patch your_version

有关更多信息,请查看rbenv Wiki。

添加gem 'certified', '~> 1.0'到我的Gemfile和运行bundle解决了我的这个问题。