

Stunnel uses SSL certificate to secure its connections, which you can easily create using the OpenSSL package: openssl genrsa -out key.pem 2048 Note: The client = no part isn’t necessary, Stunnel by default is set to server mode. So overall the “nf” file must contain the lines below: client = no Squid proxy by default runs on localhost and port 3128 so we have to tell Stunnel to forward accepted connections to that port: Then depending on the service you’re going to use the secure tunnel on, you must specify the port and IP address of that in the configuration file Basically Stunnel takes packets from a secure port and then forwards it to the port and IP address of the service you specified. This can be any of the 65535 ports, as long as it’s not blocked by another service or firewall:
#Stunnel windows 7 how to
We’ll explain how to install and configure Squid in Step 6.Īfter setting a name for the service you’re going to use, you must tell Stunnel to listen on which port for that service. Here as an example we’re going to secure traffics between Squid proxy server and a client using Stunnel. It can be any of the services which use networking such as mail server, proxy server, etc. Next we specify a service for use with Stunnel. We’re going to be using a SSL certificate to identify ourselves to the server so we have to set the path to that certificate in “nf” file using this line (We will create the certificate file in the next step): cert = /etc/stunnel/stunnel.pem

Stunnel configures itself using a file named “nf” which by default is located in “/etc/stunnel”.Ĭreate a “nf” file in the “/etc/stunnel” directory: nano /etc/stunnel/nf
#Stunnel windows 7 code
Install Stunnel package using the code below: apt-get install stunnel4 -y

#Stunnel windows 7 update
Using these commands update your Ubuntu’s package list and also upgrade the existing packages to the latest version: apt-get update

It’s somehow like a small secure VPN that runs on specific ports. What Stunnel basically does is that it turns any insecure TCP port into a secure encrypted port using OpenSSL package for cryptography. It can be used to add SSL functionality to commonly used inetd daemons like POP2, POP3, and IMAP servers without any changes in the program’s code. The Stunnel program is designed to work as an SSL encryption wrapper between remote client and local (inetd-startable) or remote server.
