How to view the expiry date of an ssl certificate on crt file
openssl x509 -noout -in wildcard.ashishnepal.com.crt -dates
notBefore=Aug 21 16:43:10 2011 GMT
notAfter=Aug 21 16:43:10 2014 GMT
How to view the expiry date of an ssl certificate on domain
openssl s_client -connect kb.ashishenpal.com:443 | openssl x509 -text
[You would see this section before public key Fingreprint]
Not Before: Jan 29 00:00:00 2010 GMT
Not After : Jan 28 23:59:59 2014 GMT
I came across Very nice script provided by Matty, which is available at http://prefetch.net/code/ssl-cert-check
and http://prefetch.net/articles/checkcertificate.html this script does exactly what you would be looking for.
Using this script you could get verity of options where simply you can create a list of domain inside a file and read file . Here ssl_spy.sh is this ssl_checker script, ssl_check.txt is the file which contains all those domain i want to check and firstname.lastname@example.org is my email address where i want to get notified, -f is option for file read and -q is quite -x is time if less than 60 it will notify me in given email.
/bin/bash /home/tikejhya/bin/ssl_spy.sh -a -f /home/tikejhya/bin/ssl_check.txt -q -x 60 -e email@example.com