Skip to content

Instantly share code, notes, and snippets.

@colehocking
Last active May 2, 2019 16:05
Show Gist options
  • Save colehocking/a3e4c0eb60e9358ea9c28a79bd88bb6f to your computer and use it in GitHub Desktop.
Save colehocking/a3e4c0eb60e9358ea9c28a79bd88bb6f to your computer and use it in GitHub Desktop.
Check Certificate status
#!/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