Saturday, January 21, 2012

Certificate verify failed on Ruby 1.9 Ubuntu Solution

I hope you find this, it will save you hours of googling.

Are you getting a certificate verify failed error in Ruby 1.9? I had this problem while trying to use Amazon's MTurk / Mechanical Turk api for AWS. It could honestly be ANYTHING that tries to connect to another website that might have this error come up. Have you found a billion websites that suggest doing something like turning off SSL verification. Well, that would work. Or you could fix this damn problem.

COMMAND PROMPT: export SSL_CERT_DIR=/etc/ssl/certs

If this helped you at all, you owe me a link back to my blog. Wasted a ton of time finding this. XD

http://bugs.ruby-lang.org/issues/3150

Things not to waste time with (that might work):
  • OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
  • http.ca_file = "/etc/ssl/certs/ca-certificate.crt"