Upgrading to stunnel 4
stunnel
is a great tool. It allows you to encrypt TCP connections inside SSL.
And it’s available for both Unix and Windows. I use it to hide various traffic, including the cvsup
I run to update this website and the zone files on my DNS servers. See stunnel – another way to avoid plain text passwords
and stunnel – encryption and security for my previous articles.
Recently, stunnel
4.0 came out with many new improvements. Much to the annoyance
of some users, the command line paramaters changed drastically. Personally, I thought that was a good thing.
Version 4 uses a configuration file, and comes with enhanced capability. I like it.
This article will compare my old command line format with the new configuration file format. Hopefull that will
help you along the way.
Note that I’ve had success in mixing v3 and v4 of stunnel. Specifically, I’ve run v4 on my clients and v3 on the server.
With the success there, I’m quite sure that it would work the other way around too.
man pages – make the migration easier
If you are upgrading to version 4, you probably already have that man page. But what you may not have is the
version 3 man page. I found that having the old man page greatly simplified
the conversion process. Just look up the old parameter, find out what it does, then look up the same option
on the version 4 man page.
How did I create these html files? Like this:
nroff -man ~/tmp/stunnel-3.22/stunnel.8 | man2html -title "stunnel(8) - version 3" > stunnel-v3-man.html
man stunnel | man2html -title "stunnel(8) - version 4" > stunnel-v4-man.html
man2html
is in the FreeBSD Ports tree
and the home page is at http://www.oac.uci.edu/indiv/ehood/man2html.html.
This assumes that I had v4 already installed and that I had extracted the tarball for v3 into the
~/tmp
directory.
The startup scripts
This section compares the old and new startup scripts (/usr/local/etc/rc.d/stunnel.sh
.
As you can see the old script put the parameters right in the script. I prefer the new format.
# Where is the program case "$1" in stop) *) |
The configuration format
I will provide a one-to-one mapping for each parameter used in the above example.
That should help you get started. The configuration file is /usr/local/etc/stunnel/stunnel.conf
.
The following is for a client.
See man stunnel
for more information.
A sample client configuration file
Here is the configuration file I use on my web server in order to access my webserver. The IP address
hsa been changed.
|
The major differences are hightlighted in
One of my favourite tools
6 thoughts on “Upgrading to stunnel 4”Leave a CommentYou must be logged in to post a comment. |
ok, so i’ve got stunnel set up exactly the way you’ve set it up here. when i connect from the client to localhost:5999, it tunnels fine, but then the cvsup client reports an unexpected EOF (or something to this effect), and the stunnel log says "SSL_connect: Peer suddenly disconnected". any ideas?
steeef wrote:
> any ideas?
Yes. Post in the FreeBSD Support section of this website.
Hello. Did you by the way get that function correctly? I make my practical training ith this same stunnel and get the same log-file …
SSL_connect: Peer suddenly disconnected
CAn you help me a little bit and say what the problem is??
Hi. I’m also encountering this problem. Do you know what the problem is?
I realise this is an old thread but has anyone tried ;
socket = r:SO_LINGER=1:60
Juggle remote setting with others as necessary.
Sweet page. I upgraded to 4.x and was having a helluva time figuring out why none of my scripts worked. For some reason the man pages were no help. You are awesome.