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

后端 未结 30 2847
太阳男子
太阳男子 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 05:08

    The issue is that ruby can not find a root certificate to trust. As of 1.9 ruby checks this. You will need to make sure that you have the curl certificate on your system in the form of a pem file. You will also need to make sure that the certificate is in the location that ruby expects it to be. You can get this certificate at...

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

    If your a RVM and OSX user then your certificate file location will vary based on what version of ruby your using. Setting the path explicitly with :ca_path is a BAD idea as your code will not be portable when it gets to production. There for you want to provide ruby with a certificate in the default location(and assume your dev ops guys know what they are doing). You can use dtruss to work out where the system is looking for the certificate file.

    In my case the system was looking for the cert file in

    /Users/stewart.matheson/.rvm/usr/ssl/cert.pem
    

    however MACOSX system would expect a certificate in

    /System/Library/OpenSSL/cert.pem
    

    I copied the downloaded cert to this path and it worked. HTH

提交回复
热议问题