Skip to content

Instantly share code, notes, and snippets.

@tahb
Created May 18, 2015 14:29
Show Gist options
  • Save tahb/b310feaba98498828e93 to your computer and use it in GitHub Desktop.
Save tahb/b310feaba98498828e93 to your computer and use it in GitHub Desktop.
Fingerprint for Certificate with OpenSSL
cert = OpenSSL::X509::Certificate.new(x)
fingerprint = OpenSSL::Digest::SHA1.new(cert.to_der).to_s
puts fingerprint.scan(/.{2}/).join(":").upcase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment