Skip to content

Instantly share code, notes, and snippets.

@paweldudek
Last active August 29, 2015 14:19
Show Gist options
  • Save paweldudek/32e520f0938d1bb31b67 to your computer and use it in GitHub Desktop.
Save paweldudek/32e520f0938d1bb31b67 to your computer and use it in GitHub Desktop.
# Works just fine
uri = URI('https://api.twitter.com/1.1/statuses/mentions_timeline.json')
http = Net::HTTP.new(uri.hostname, uri.port)
http.use_ssl = true
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts res.body
# Results in an error
uri = URI('https://rink.hockeyapp.net/api/2/auth_tokens')
http = Net::HTTP.new(uri.hostname, uri.port)
http.use_ssl = true
req = Net::HTTP::Get.new(uri)
res = http.request(req)
# The aforementioned error
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
@paweldudek
Copy link
Author

Checking OpenSSL version used by Ruby:

bundle exec irb 

'2.0.0-p576 :001 > OpenSSL::OPENSSL_LIBRARY_VERSION
 => "OpenSSL 1.0.2a 19 Mar 2015" 

It appears that using anything that is later than 1.0.1j (version from Sept 2014 AFAIR) causes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment