Skip to content

Instantly share code, notes, and snippets.

@kenn
Created December 1, 2012 00:33
Show Gist options
  • Select an option

  • Save kenn/4179767 to your computer and use it in GitHub Desktop.

Select an option

Save kenn/4179767 to your computer and use it in GitHub Desktop.
require 'net/https'
host = 'www.google.com'
port = 443
# http = Net::HTTP.new(host, port)
http = Net::HTTP::Proxy('127.0.0.1', 8888).new(host, port)
http.use_ssl = true
http.start do |conn|
cert = OpenSSL::X509::Certificate.new conn.peer_cert
p cert.not_after
p cert.subject
p cert.issuer
puts cert.to_text
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment