Wednesday, May 9, 2012

Ruby: OpenSSL::SSL::SSLError with Mechanize

Have you ever seen an error like below while playing with Ruby/Mechanize with HTTPS links?

`connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)

The simple solution to overcome this error by setting SSL verification is false. You can do this like this way with your mechanize agent

a.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE

1 comment:

da99 said...

Thank you so much. I search and couldn't find it. It's great for local/dev testing.

Get function name programaticaly - Python

This little piece of code will help you to get the function name programatically. This is very helpful when you are implementing the debug...