linux verify dates of SSL certificates

All questions related to servers
Post Reply
mister_v
Posts: 182
Joined: Thu Mar 04, 2010 9:19 pm

linux verify dates of SSL certificates

Post by mister_v »

Hi, does anyone knows the linux command to show the expire date of an SSL certificate ?
chris
Site Admin
Posts: 188
Joined: Mon Jul 21, 2008 9:52 am

Re: linux verify dates of SSL certificates

Post 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
chris
Site Admin
Posts: 188
Joined: Mon Jul 21, 2008 9:52 am

Re: linux verify dates of SSL certificates

Post by chris »

If you havce access to the file directly:

Code: Select all

less certificate.crt | openssl x509 -noout -dates
Post Reply