Skip to content

Instantly share code, notes, and snippets.

Avatar

Fernando Tobar fertobar

View GitHub Profile
@fertobar
fertobar / OpenSSL fix.md
Last active Sep 19, 2015 — forked from mislav/OpenSSL fix.md
Fix OpenSSL certificate errors on Ruby 2.0
View OpenSSL fix.md

The reason why you might get certificate errors in Ruby 2.0 when talking HTTPS is because there isn't a default certificate bundle that OpenSSL (which was used when building Ruby) trusts.

Update: this problem is solved in edge versions of rbenv and RVM.

$ ruby -rnet/https -e "Net::HTTP.get URI('https://github.com')"
net/http.rb:917:in `connect': SSL_connect returned=1 errno=0 state=SSLv3
  read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)

You can work around the issue by installing a certificate bundle that you trust. I trust Mozilla and curl.

You can’t perform that action at this time.