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

请建议. .


当前回答

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

其他回答

在最新macport的Mac OS X Lion上:

sudo port install curl-ca-bundle  
export SSL_CERT_FILE=/opt/local/share/curl/curl-ca-bundle.crt  

然后,重新运行失败的作业。

注意,自从Eric G在5月12日回答后,证书文件的位置似乎发生了变化。

如果您在Leopard上有特别的问题,以下是我所做的帮助。

我的证书已经旧了,需要更新。我下载了这个:

http://curl.haxx.se/ca/cacert.pem

然后替换了我在Leopard上找到的证书

/usr/share/curl/curl-ca-bundle.crt

重新加载正在访问它的任何东西,你应该很好!

只是因为对我有用的说明略有不同,我想我补充一下我的意见:

我在OS X Lion和使用macports和rvm

我安装了curl-ca-bundle:

sudo port install curl-ca-bundle

然后我调整了我的omniauth配置如下:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :google_oauth2, APP_CONFIG['CONSUMER_KEY'], APP_CONFIG['CONSUMER_SECRET'],
           :scope => 'https://www.google.com/m8/feeds https://www.googleapis.com/auth/userinfo.profile',
           :ssl => {:ca_path => "/share/curl/curl-ca-bundle.crt"}
end

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

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

brew update
brew remove openssl
brew install openssl

最新的rubygem-update-2.6.7已经解决了这个问题。http://guides.rubygems.org/ssl-certificate-update/