I am trying to use signet for OAuth to Google services. And get this error:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Following these questions:
Seems the solution is either to fix ca_path
or to set .VERIFY_NONE
for SSL
The ca_path
fix posted only works on Linux (port install) and the fix for VERIFY_NONE
seems to be for faraday.
Is there a solution for Windows/signet gem?
The Ruby OpenSSL error certificate verify failed means your code can't verify that the SSL certificate of the website or API you're connecting to is the real one. It's important to solve this issue correctly to keep your communication secure.
To verify that a certificate is installedOpen the Cerificates console. In the navigation pane, expand Trusted Root Certification Authorities, and then click Certificates. The CA that you created appears in the list.
Actually the best way I found to solve this in windows for Ruby itself, not just one gem, is to do the following:
Create a new System Variable:
Variable: SSL_CERT_FILE Value: C:\RailsInstaller\cacert.pem
Close all your command prompts, including your Rails server command prompt, etc.
Start a new ruby irb prompt, and try the following:
$irb>require 'open-uri' $irb>open('https://www.gmail.com')
It should all work now just fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With