Skip to content

Instantly share code, notes, and snippets.

@ralavay
Last active December 28, 2018 08:17
Show Gist options
  • Save ralavay/d0b799eb2e68c498015165df301e5602 to your computer and use it in GitHub Desktop.
Save ralavay/d0b799eb2e68c498015165df301e5602 to your computer and use it in GitHub Desktop.
Show SSL cert expiration date
# Put this into ~/.profile
# Usage:
# cert-check domain.name
# Example:
# cert-check www.google.com
function cert-check() {
yes QUIT | openssl s_client -showcerts -servername $1 -connect $1:443 > /tmp/$1.pem && openssl x509 -inform PEM -in /tmp/$1.pem -text -out certdata | grep -i 'not after'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment