Skip to content

Instantly share code, notes, and snippets.

@pmclanahan
Created December 22, 2015 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmclanahan/3eae1feb3a8f7acf5d8b to your computer and use it in GitHub Desktop.
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
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