Show the valid timespan for a mailserver tls certificate

Published: 25.08.2025 | 45 Words | 1 minutes

This bash/ fish command will print the time a tls cert of a mailserver (smtp) is valid.

openssl s_client -showcerts -connect mail.m2rocks.de:993 -servername mail.m2rocks.de 2>/dev/null | openssl x509 -noout -dates

To view the whole cert chain use:

openssl s_client -showcerts -connect mail.m2rocks.de:993 -servername mail.m2rocks.de 2>/dev/null
That's all ;)
Back to the top