Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Original netcat doesn't support ssl. ncat from nmap project does.
In linux, we can connect multiple commands with pipeline.
Is it possible to combine netcat and openssl to create a ncat?

share|improve this question
up vote 1 down vote accepted

No doubt you can do it with stunnel, a generic program that makes TCP connections such that they're done with SSL.

It's generic, so it make POP go through SSL too, making Secure POP, or it could do HTTP.

share|improve this answer

Use stunnel+netcat to connect smtp.gmail.com:

$ grep smtp /etc/services
smtp            25/tcp          mail
ssmtp           465/tcp         smtps           # SMTP over SSL

$ cat stunnel.conf
[gmail-smtp]
client = yes
accept = localhost:smtp
connect = smtp.gmail.com:ssmtp

$ sudo stunnel4 stunnel.conf

$ nc -C localhost smtp
220 mx.google.com ESMTP s7sm6983451paz.7
ehlo
250-mx.google.com at your service, [112.91.181.20]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH XOAUTH2
250 ENHANCEDSTATUSCODES
quit
221 2.0.0 closing connection s7sm6983451paz.7
share|improve this answer

Socat is netcat on steroids. If you can use socat, see Securing Traffic Between two Socat Instances Using SSL

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .