Skip to content

Instantly share code, notes, and snippets.

@joeyates
Last active January 25, 2021 15:21
Show Gist options
  • Save joeyates/c79d64a396991306d0ffca831b6a7880 to your computer and use it in GitHub Desktop.
Save joeyates/c79d64a396991306d0ffca831b6a7880 to your computer and use it in GitHub Desktop.
Get the expiry date for an online TLS/SSL certificate
#!/usr/bin/env bash
hostname=$1
online-certificate $hostname | \
openssl x509 -inform pem -noout -enddate
#!/usr/bin/env bash
hostname=$1
echo | \
openssl s_client \
-connect $hostname:443 \
-servername $hostname \
2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment