Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

3 Answers 3

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

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

$ cat stunnel.conf
client = yes
accept = localhost:smtp
connect =

$ sudo stunnel4 stunnel.conf

$ nc -C localhost smtp
220 ESMTP s7sm6983451paz.7
ehlo at your service, []
250-SIZE 35882577
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

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.