Replace the server name and the port. Usually the port will be 25.
openssl s_client -connect <hostname>:<port> -starttls smtp
eg:
openssl s_client -connect smtp.office365.com:587 -starttls smtp
Copy the output section of the certificate that looks like below.
-----BEGIN CERTIFICATE-----
###bunch of encoded text###
-----END CERTIFICATE-----
You can copy it and save it to a file with ".crt" or ".cert" extension and that's the mail server's certificate.
Make sure to include the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines.
Note: OpenSSL is required.
Ubuntu: sudo apt install openssl
Other OSs: https://wiki.openssl.org/index.php/Binaries
Comments
Post a Comment