Skip to content

Instantly share code, notes, and snippets.

@mcrmfc
Created October 19, 2011 10:37
Show Gist options
  • Save mcrmfc/1297939 to your computer and use it in GitHub Desktop.
Save mcrmfc/1297939 to your computer and use it in GitHub Desktop.
ruby ssl
require "net/https"
require "uri"
uri = URI.parse('https://repo.dev.bbc.co.uk')
pem = File.read("../../keys/combine.pem")
#http = Net::HTTP::Proxy('www-cache.reith.bbc.co.uk', 80).new(uri.host, uri.port)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.cert = OpenSSL::X509::Certificate.new(pem)
http.key = OpenSSL::PKey::RSA.new(pem)
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
p response.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment