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

请建议. .


当前回答

只需在gemfile中添加gem 'certified',然后运行bundle install。

宝石“认证” 包安装

其他回答

添加到你的gemfile:

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

如果你在本地运行你的rails应用程序,那么只需在application.rb底部添加这一行。

OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

在此之后,您可以使用应用程序没有任何问题。你可以称之为黑客,但不建议这样做。只在需要本地运行时使用

新的认证宝石旨在解决这个问题:

https://github.com/stevegraham/certified

如果你在/usr/local/etc/openssl中有一个指向cert.pem的符号链接,尝试这样做:

ruby -ropenssl -e "p OpenSSL::X509::DEFAULT_CERT_FILE" (should be /usr/local/etc/openssl)
cd /usr/local/etc/openssl
wget http://curl.haxx.se/ca/cacert.pem
ln -s cacert.pem 77ee3751.0 (77ee3751.0 is my symbolic link, should depend on the openssl version)

OSX的解决方案:

安装最新的RVM稳定版本

rvm get stable

使用RVM命令自动解析证书

rvm osx-ssl-certs update all