Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to test client connections with IMAP over SSL, HTTPS, and other secure text-based Internet protocols over SSL/TLS, the same way I would using Telnet or Netcat if they were not tunneled over a secure protocol. Is there a way to get Telnet or Netcat to go through SSL/TLS such as with a pipe or alternate program?

share|improve this question
Same on serverfault: serverfault.com/questions/102032/… –  Ciro Santilli Dec 8 at 23:18

1 Answer 1

First, there is no Telnet/Netcat client – they are two separate programs. Second, there is no "the" – there exist at least 10 different Telnet clients and at least 6 different Netcat versions.

  • GnuTLS on Linux:

    gnutls-cli imap.gmail.com -p 993

    Use -s for STARTTLS; you will need to manually enter the necessary protocol commands and press CtrlD when ready.

    Note that GnuTLS verifies the server certificate by default, but other tools below do not.

  • OpenSSL has a SSL client tool:

    openssl s_client -connect imap.gmail.com:993

    This is available for all operating systems. STARTTLS is supported via -starttls imap or -starttls smtp options, and the program will automatically negotiate it.

  • socat:

    socat openssl:imap.gmail.com:993 stdio

    readline mode can be used for convenience:

    socat ssl:imap.gmail.com:993 readline

    STARTTLS is not supported.

  • ncat from nmap:

    ncat --ssl imap.gmail.com 993
  • Some Telnet clients, such as the telnet-ssl package on Debian:

    telnet-ssl -z ssl imap.gmail.com 993
share|improve this answer
I wish I could simply favorite your answer instead of the question that the asker didn't even bother marking as accepted. –  Sammitch Nov 19 at 22:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.