Skip to content

Instantly share code, notes, and snippets.

@magickatt
Created March 30, 2020 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magickatt/cf7767634d86eba5527e7f64ed50f50a to your computer and use it in GitHub Desktop.
Save magickatt/cf7767634d86eba5527e7f64ed50f50a to your computer and use it in GitHub Desktop.
Check SSL certificate validity
HOSTNAME=example.com && \
echo | openssl s_client -showcerts \
-servername $HOSTNAME \ # Required for SNI
-connect $HOSTNAME:443 2>/dev/null | \
openssl x509 -inform pem -noout -text | \
grep Validity -A 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment