Last active
December 28, 2015 05:59
-
-
Save elasticdog/7454165 to your computer and use it in GitHub Desktop.
verify the ssl certificate chain for multiple domains using openssl
This file contains 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/bash | |
readonly FILE='domains.list' | |
readonly MAX_CHAIN_LENGTH=5 | |
readonly PORT=443 | |
while IFS= read -r domain; do | |
echo -ne "${domain} $(/usr/bin/dig ${domain} +short | tail -n 1)\n" | |
echo QUIT | /usr/bin/openssl s_client -verify ${MAX_CHAIN_LENGTH} -connect ${domain}:${PORT} 2>1 | grep 'Verify return code' | |
done < "$FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment