Skip to content

Instantly share code, notes, and snippets.

@ffittschen
Last active September 9, 2016 10:37
Show Gist options
  • Save ffittschen/65a16e611b7302ddc11726c2cc7df73f to your computer and use it in GitHub Desktop.
Save ffittschen/65a16e611b7302ddc11726c2cc7df73f to your computer and use it in GitHub Desktop.
Check mail server certificate expiry

How to show the expiration date of certificates of a mail server

openssl s_client -connect host:port | openssl x509 -enddate -noout

e.g. the command

openssl s_client -connect imap.gmail.com:993 | openssl x509 -enddate -noout

returns:

depth=2 /C=US/O=GeoTrust Inc./CN=GeoTrust Global CA
verify error:num=20:unable to get local issuer certificate
verify return:0
notAfter=Nov 24 13:45:00 2016 GMT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment