How to inspect the certificate of a mail server over a CLI – seanthegeek.net
| On
November 29, 2018 11:17 pm

How to inspect the certificate of a mail server over a CLI

By Sean Whalen

If you ever need to inspect the certificate of a remote SMTP server, you can use the openssl CLI tool.

If you need to check STARTTLS:

openssl s_client -connect mail.example.com:25 -starttls smtp

Or, for a standard secure SMTP port:

openssl s_client -connect mail.example.com:465

To save the certificate to a file, just redirect the output:

openssl s_client -connect mail.example.com:25 -starttls smtp > mail.example.com.crt

You can also check SMTP TLS using MX Toolbox or Check TLS.

This post was last modified on June 3, 2019 6:59 pm

Sean Whalen

Sean Whalen is an Information Security Engineer in the healthcare industry, and founder of the InfoSec Speakeasy, specializing in intelligence and malware analysis. Previously, he worked as an intelligence analyst in the defense industry. He has a passion for open source software, and sci-fi.

View Comments

  • Many thanks for this post, really helped me. :)

    Cancel reply

    Leave a Comment

Leave a Comment