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

请建议. .


当前回答

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

其他回答

添加gem 'certified', '~> 1.0'到我的Gemfile和运行bundle解决了我的这个问题。

我试着用brew安装curl-ca-bundle,但这个包已经没有可用的了:

$ brew install curl-ca-bundle
Error: No available formula for curl-ca-bundle 
Searching formulae...
Searching taps...

对我来说,Mac上的解决方案是:

 $ cd /usr/local/etc/openssl/certs/
 $ sudo curl -O http://curl.haxx.se/ca/cacert.pem

在~/中添加这一行。Bash_profile(或~/.)ZSHRC for zsh):

export SSL_CERT_FILE=/usr/local/etc/openssl/certs/cacert.pem

然后更新你的终端:

$ source ~/.bash_profile

我在尝试为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签名的证书。

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

宝石“认证” 包安装

对我来说,有效的答案是:

# Reinstall OpenSSL
brew update
brew remove openssl
brew install openssl
# Download CURL CA bundle
cd /usr/local/etc/openssl/certs
wget http://curl.haxx.se/ca/cacert.pem
/usr/local/opt/openssl/bin/c_rehash
# Reinstall Ruby from source
rvm reinstall 2.2.3 --disable-binary