Created
November 26, 2024 08:41
-
-
Save larstobi/0e3c312b9cb1e8be24e34bd229e140fe to your computer and use it in GitHub Desktop.
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
if echo | openssl s_client -servername example.com -connect example.com:443 2>/dev/null | \ | |
openssl x509 -noout -checkend $((30*24*60*60)) >/dev/null; then | |
echo "Certificate is valid for more than 30 days." | |
else | |
echo "Certificate expires in less than 30 days!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment