Last active
May 2, 2019 16:05
-
-
Save colehocking/a3e4c0eb60e9358ea9c28a79bd88bb6f to your computer and use it in GitHub Desktop.
Check Certificate status
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/bash | |
if [[ $# -ne 1 ]] | |
then | |
echo "Usage: ./check_cert.sh <domain>" | |
exit(1) | |
fi | |
DOMAIN=$1 | |
checkcert(){ | |
openssl s_client -showcerts -connect ${DOMAIN}:443 | |
} | |
checkcert | |
# Check expiration date | |
checkcert 2>/dev/null | openssl x509 -noout -dates |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment