If you have software that doesn't support SSL, and you want to secure network connections, you can encapsulate it in an SSL tunnel. This tunnel will encrypt data from end to end.
Download the client: https://www.stunnel.org/download/binaries.html On Windows, all configuration files are in "C:\Program Files\stunnel", so adapt the examples below according to file paths
Configuration
Serveur
Don't modify the /etc/stunnel/stunnel.conf file; it's preferable to create a separate file (for example "/etc/stunnel/services.conf"). Here's an example of the file contents that will forward telnet and a VNC connection (assuming a VNC server is running on port "5901").
cert=/etc/stunnel/stunnel.pem# Certificate to useCAfile=/etc/stunnel/stunnel.pem# sameverify=3# Certificate verification level##Service Definitions##[Telnet]# Service Nameaccept=88.191.31.151:12345# Server address hosting the service: Secure alternative portconnect=127.0.0.1:23# Local server address: Real service port[VNC]# Service Nameaccept=88.191.31.151:54321# Server address hosting the service: Secure alternative portconnect=127.0.0.1:5901# Local server address: Real service port
Client
As with the server, it's preferable to create a separate configuration file (still "/etc/stunnel/services.conf"). This file will be similar to the server file except that the service logic is reversed and the "Client" option is defined:
client=yes# Indicates this is the clientcert=/etc/stunnel/stunnel.pem# Certificate to useCAfile=/etc/stunnel/stunnel.pem# sameverify=3# Certificate verification level##Service Definitions##[Telnet]# Service Nameaccept=127.0.0.1:23# Server address hosting the service: Secure alternative portconnect=88.191.31.151:12345# Local server address: Real service port[VNC]# Service Nameaccept=127.0.0.1:5901# Server address hosting the service: Secure alternative portconnect=88.191.31.151:54321# Local server address: Real service port
Generation du Certificat
Create a file "/etc/stunnel/cert.conf" with the following lines: