Created
February 4, 2018 04:34
-
-
Save pgporada/7391863e37d329e37a746b5207510a07 to your computer and use it in GitHub Desktop.
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 | |
# AUTHOR: Phil Porada | |
DOMAIN=${1} | |
CERT=$(openssl s_client -connect ${DOMAIN}:443 2>&1 < /dev/null | sed -n '/-----BEGIN/,/-----END/p') | |
SANS=$(openssl x509 -noout -text -in <(echo "${CERT}") | grep '^[[:space:]]*Subject: CN=' | sed 's/^[[:space:]]*Subject: CN=//') | |
echo "${SANS}" | |
################################################## | |
##################### OUTPUT ##################### | |
################################################## | |
$ ./check_cert.sh download.osmc.tv | |
my.osmc.tv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment