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

请建议. .


当前回答

我有好几天都遇到了麻烦,到处乱闯。这个链接证明对我非常有帮助。它帮助我在MAC OS X 9上成功升级了SSL。

其他回答

Ruby找不到任何可以信任的根证书。

看看这篇博客文章的解决方案:“Ruby 1.9和SSL错误”。

解决方案是安装curl-ca-bundle端口,其中包含Firefox使用的相同根证书: Sudo端口安装curl-ca-bundle 并告诉你的HTTPS对象使用它: https。Ca_file = '/opt/local/share/curl/curl-ca-bundle.crt' 注意,如果你想让你的代码在Ubuntu上运行,你需要设置ca_path属性,使用默认的证书位置/etc/ssl/certs.

OSX的解决方案:

安装最新的RVM稳定版本

rvm get stable

使用RVM命令自动解析证书

rvm osx-ssl-certs update all

这可能是损坏/无效SSL证书的问题。在mac上可以使用此命令更新SSL证书:

rvm osx-ssl-certs update all

一行程序在Admin提示符中修复了Windows的问题

巧克力安装wget(第一次见chocolatey.org)

wget http://curl.haxx.se/ca/cacert.pem -O C:\cacert.pem && setx /M SSL_CERT_FILE "C:\cacert.pem"

或者这样做:

gem sources -r https://rubygems.org/
gem sources -a http://rubygems.org/

Milanio的方法:

gem sources -r https://rubygems.org
gem sources -a http://rubygems.org 
gem update --system
gem sources -r http://rubygems.org
gem sources -a https://rubygems.org

gem install [NAME_OF_GEM]

有时这并不总是rvm的问题 在MAC OSX中,如果你删除了.rvm,问题仍然存在(特别是当你从timemachine备份数据时),你可以尝试这种方式。

1.brew update
2.brew install openssl