Você deve usar socat .
Securing Traffic Between two Socat Instances Using SSL
Introduction
When you want to connect two socat processes running on different machines and feel that you need to protect the connection against unauthorized access, sniffing, data manipulation etc., you might want to encrypt the communications.
For this purpose socat integrates the OpenSSL library and provides SSL client and server features.
...