Created
December 22, 2015 18:47
-
-
Save pmclanahan/3eae1feb3a8f7acf5d8b to your computer and use it in GitHub Desktop.
a bash function for checking whether an ssl endpoint is returning a sha1 cert for SSLv3
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
sha1certcheck() { | |
cert_type=$( : | openssl s_client -connect ${1}:443 -ssl3 -cipher 'DES-CBC3-SHA' 2>/dev/null <<< Q | openssl x509 -text | grep 'Signature Algorithm' | cut -d ':' -f 2 | uniq) | |
if [ "${cert_type:1}" = "sha1WithRSAEncryption" ]; then | |
echo "All's well" | |
else | |
echo "Bad cert type: $cert_type" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment