Created
August 9, 2013 21:09
-
-
Save bijanebrahimi/6197219 to your computer and use it in GitHub Desktop.
Check certification fingerprints using openssl in bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# usage: certcheck hostname [port] | |
# | |
REMHOST=$1 | |
REMPORT=${2:-443} | |
echo |\ | |
openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |\ | |
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 -sha1 -noout -fingerprint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment