Wednesday, May 9, 2012

Ruby: OpenSSL::SSL::SSLError with Mechanize


Share at Facebook

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.