Avoid certificate errors in Ruby

Categories: Ruby

If you have a Ruby script and wish to hide certificate errors just add this on top of the script:

# avoid certificate errors 
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG = nil

References:

https://stackoverflow.com/questions/1113422/how-to-bypass-ssl-certificate-verification-in-open-uri

«
»