SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

后端 未结 30 2501
太阳男子
太阳男子 2020-11-22 04:29

I am using Authlogic-Connect for third party logins. After running appropriate migrations, Twitter/Google/yahoo logins seem to work fine but the facebook login throws except

相关标签:
30条回答
  • 2020-11-22 04:58

    The reason that you get this error on OSX is the rvm-installed ruby.

    If you run into this issue on OSX you can find a really broad explanation of it in this blog post:

    http://toadle.me/2015/04/16/fixing-failing-ssl-verification-with-rvm.html

    The short version is that, for some versions of Ruby, RVM downloads pre-compiled binaries, which look for certificates in the wrong location. By forcing RVM to download the source and compile on your own machine, you ensure that the configuration for the certificate location is correct.

    The command to do this is:

    rvm install 2.2.0 --disable-binary
    

    if you already have the version in question, you can re-install it with:

    rvm reinstall 2.2.0 --disable-binary
    

    (obviously, substitute your ruby version as needed).

    0 讨论(0)
  • 2020-11-22 04:58

    This worked for me. If you using rvm and brew:

    rvm remove 1.9.3
    brew install openssl
    rvm install 1.9.3 --with-openssl-dir=`brew --prefix openssl`
    
    0 讨论(0)
  • 2020-11-22 04:59

    Well this worked for me

    rvm pkg install openssl
    rvm reinstall 1.9.2 --with-openssl-dir=$rvm_path/usr
    

    Something is wrong with openssl implementation of my ubuntu 12.04

    0 讨论(0)
  • 2020-11-22 04:59

    I had this same issue while working on a Ruby project. I am using Windows 7 64bit.

    I resolved this by:

    1. Downloading the cacert.pem file from http://curl.haxx.se/ca/cacert.pem.
    2. Saved that file to C:/RubyCertificates/cacert.pem
    3. Then set my environmental variable "SSL_CERT_FILE" to "C:\RubyCertificates\cacert.pem"

    source: https://gist.github.com/fnichol/867550

    0 讨论(0)
  • 2020-11-22 04:59

    Adding gem 'certified', '~> 1.0' to my Gemfile and running bundle solved this issue for me.

    0 讨论(0)
  • 2020-11-22 05:00

    Just because instructions were a slight bit different for what worked for me, I thought I add my 2 cents:

    I'm on OS X Lion and using macports and rvm

    I installed curl-ca-bundle:

    sudo port install curl-ca-bundle
    

    Then I adjusted my omniauth config to be this:

    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
    
    0 讨论(0)
提交回复
热议问题