Guest User

Untitled

a guest
Jan 24th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. require 'net/http'
  2. require 'net/https'
  3.  
  4. http = Net::HTTP.new('twitter.com',443)
  5. http.use_ssl = true
  6. http.verify_mode = OpenSSL::SSL::VERIFY_PEER
  7. #specifying the cert location works with ruby1.8
  8. http.ca_file = '/etc/ssl/certs/ca-certificates.crt'
  9. res = http.get("/")
  10.  
  11. puts res.body[0,100]
  12. puts res.inspect
Add Comment
Please, Sign In to add comment