mercoledì, dicembre 09, 2015

How to securely connect to IMAP using OpenSSL

I never knew how to connect to an IMAP server when SSL/TLS were forced. With unencrypted connections, you can just Telnet in, but this exposes your login credentials and data, so many servers will not allow that. The secure equivalent to Telnet, I found, is OpenSSL's s_client tool. The documentation clearly labels it as a debug tool.

You'd resort to either connection method for verification or troubleshooting purposes; I can't imagine anyone wanting to do employ Telnet or s_client regularly — rather than use some mail client.

As an example, here's how you could log into an Exchange account, select the Inbox folder, and log out:

# openssl s_client -connect server:port -crlf
? LOGIN username password
? SELECT Inbox

Nessun commento :

Posta un commento