Skip to content

Instantly share code, notes, and snippets.

@donpdonp
Created August 18, 2011 19:27
Show Gist options
  • Save donpdonp/1154936 to your computer and use it in GitHub Desktop.
Save donpdonp/1154936 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'net/https'
http = Net::HTTP.new('twitter.com',443)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
#specifying the cert location works with ruby1.8
http.ca_file = '/etc/ssl/certs/ca-certificates.crt'
res = http.get("/")
puts res.body[0,100]
puts res.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment