Skip to content

Instantly share code, notes, and snippets.

@axgle
Created October 22, 2009 03:01
Show Gist options
  • Save axgle/215678 to your computer and use it in GitHub Desktop.
Save axgle/215678 to your computer and use it in GitHub Desktop.
require 'openssl'
data=`echo 'quit'|openssl s_client -connect google.com:443 2> /dev/null &`
cert = OpenSSL::X509::Certificate.new(data)
ms=cert.methods-Object.methods
ms=ms-ms.grep(/=|to|public_key/)
puts ms.map{|m|[m,(cert.send(m) rescue nil)]}.select{|a,b|!b.nil?}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment