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

请建议. .


当前回答

如果你在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和伊恩·康纳。

其他回答

我在尝试为Rails 3使用JQuery生成器时遇到了类似的问题

我是这样解决的:

Get the CURL Certificate Authority (CA) bundle. You can do this with: sudo port install curl-ca-bundle [if you are using MacPorts] or just pull it down directly wget http://curl.haxx.se/ca/cacert.pem Execute the ruby code that is trying to verify the SSL certification: SSL_CERT_FILE=/opt/local/etc/certs/cacert.pem rails generate jquery:install. In your case, you want to either set this as an environment variable somewhere the server picks it up or add something like ENV['SSL_CERT_FILE'] = /path/to/your/new/cacert.pem in your environment.rb file.

您还可以将CA文件(我没有尝试过)安装到操作系统—这里有很长的说明—这应该以类似的方式工作,但我个人没有尝试过。

基本上,您遇到的问题是一些web服务正在响应针对OpenSSL无法验证的CA签名的证书。

在Ruby 2.3.4中遇到这个问题:

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

酿造卸载——忽略依赖openssl

然后

安装openssl

它做到了。

对我来说最直接的答案是

sudo apt-get install openssl ca-certificates

瞧! !

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

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

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

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

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

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

添加到你的gemfile:

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