我使用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'

请建议. .


当前回答

然后,正如这篇博客文章所建议的,

“如何治愈Net::HTTP的风险默认HTTPS行为”

您可能需要安装always_verify_ssl_certificates gem,该gem允许您为ca_file设置默认值。

其他回答

我通过在终端中运行这个解决了这个问题。完整的记录可以在这里找到

rvm install 2.2.0 --disable-binary

添加到你的gemfile:

git => git://github.com/ yaauie/clivers, ref => 5617c

这对我很管用。如果你使用rvm和brew:

rvm remove 1.9.3
brew install openssl
rvm install 1.9.3 --with-openssl-dir=`brew --prefix 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

只需运行certification -update可执行文件,该命令将确保您的所有证书都是最新的。

这适用于我在Windows中的Ruby on Rails应用程序。