Created
August 18, 2011 19:27
-
-
Save donpdonp/1154936 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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