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

宝石“认证” 包安装

其他回答

一行程序在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]

在Ruby 2.3.4中遇到这个问题:

我解了OpenSSL,然后重新安装。我跑:

酿造卸载——忽略依赖openssl

然后

安装openssl

它做到了。

我在开发Ruby项目时遇到了同样的问题。我使用的是64bit的Windows 7。

我是这样解决的:

下载cacert。来自http://curl.haxx.se/ca/cacert.pem的Pem文件。 保存到C:/RubyCertificates/cacert.pem目录下 然后设置我的环境变量“SSL_CERT_FILE”为“C:\RubyCertificates\cacert.pem”

来源:https://gist.github.com/fnichol/867550

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

rvm remove 1.9.3
brew install openssl
rvm install 1.9.3 --with-openssl-dir=`brew --prefix openssl`

如果你在OS X上使用RVM,你可能需要运行这个:

rvm osx-ssl-certs update all

更多信息请访问:http://rvm.io/support/fixing-broken-ssl-certificates

完整的解释如下:https://github.com/wayneeseguin/rvm/blob/master/help/osx-ssl-certs.md


更新

在Ruby 2.2上,你可能需要从源代码重新安装Ruby来解决这个问题。以下是如何(将2.2.3替换为Ruby版本):

rvm reinstall 2.2.3 --disable-binary

感谢https://stackoverflow.com/a/32363597/4353和伊恩·康纳。