Last active
June 3, 2020 17:59
-
-
Save gboone/d477facc81349542757b69923d945963 to your computer and use it in GitHub Desktop.
crtchk.sh
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/zsh | |
# Very much low-fi, low-tech shortcut to check a domain name passed via stdin and return details about the certificate. | |
# If `ca` is passed, the "CA Issuers" string is grepped from the output. | |
domain=${1%/} | |
echo $domain | |
if [[ $2 == "ca" ]]; then | |
echo | openssl s_client -showcerts -servername $domain -connect $domain:443 2>/dev/null | openssl x509 -inform pem -noout -text | grep "CA Issuers"; | |
else | |
echo | openssl s_client -showcerts -servername $domain -connect $domain:443 2>/dev/null | openssl x509 -inform pem -noout -text; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment