I have several SSL certificates, and I would like to be notified, when a certificate has expired.
My idea is to create a cronjob, which executes a simple command every day.
I know that the openssl
command in Linux can be used to display the certificate info of remote server, i.e.:
openssl s_client -connect www.google.com:443
But I don't see the expiration date in this output. Also, I have to terminate this command with CTRL+c.
How can I check the expiration of a remote certificate from a script (preferably using openssl
) and do it in "batch mode" so that it runs automatically without user interaction?
-servername www.google.com
for SNI enabled servers To avoid the need for termination send /dev/null to it< /dev/null
– syss Oct 9 '15 at 9:32