This is a script I call "certdays.sh" which you can call from your regular tests like this:
certdays.sh somedomain.com 14
If the certificate for somedomain.com is valid less then 14 days, it will fail:
certdays.sh somedomain.com 14
If the certificate for somedomain.com is valid less then 14 days, it will fail:
Fixed now. Thanks.
~ ~/certdays.sh google.com 14
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-
v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]]
[+format]
google.com: -18568
-n Lasts longer then 14 days?
NO!!!!!!!!!!!!!!I have put it into a Github repo now and put the link into the post. Does that work for you?
We can use this command in CI pipeline or setup a cron job to monitor it.