Page 1 of 1

linux verify dates of SSL certificates

Posted: Wed Jul 06, 2022 8:28 am
by mister_v
Hi, does anyone knows the linux command to show the expire date of an SSL certificate ?

Re: linux verify dates of SSL certificates

Posted: Fri Jul 29, 2022 7:54 am
by chris
You can use the following command :

Code: Select all

echo | openssl s_client -servername SERVERNAME -connect SERVER:PORT 2>/dev/null | openssl x509 -noout -dates
An example:

Code: Select all

echo | openssl s_client -servername www.webmaster2020.com -connect www.webmaster2020.com:443 2>/dev/null | openssl x509 -noout -dates
notBefore=Jun 24 00:00:00 2020 GMT
notAfter=Aug  1 23:59:59 2022 GMT

Re: linux verify dates of SSL certificates

Posted: Sun Jul 31, 2022 9:55 am
by chris
If you havce access to the file directly:

Code: Select all

less certificate.crt | openssl x509 -noout -dates