First start by downloading the Cygwin installation package. Follow instructions on how to proceed for installation. During installation make sure you include the following packages :
Download the 4 (stunnel.exe, libssl32.dll,libeay32.dll, stunnel.pem) to a directory included in your PATH environment variable (i.e. %WINDIR%system32).
If everything went OK with the Cygwin installation, you should now have Cygwin console in front of you. To install stunnel as a service you should now type:
# cygrunsrv -I pop3s -d 'pop3s stunnel' \
-p /cygdrive/c/WINNT/system32/stunnel.exe \
-a ' -D 7 -c -d my.computer:110 -r my.pop3s.server:995' \
-e CYGWIN='binmode ntsec
tty'
You should now be back at your Cygwin/Bash prompt, to start the service just type:
# cygrunsrv -S pop3s
To confirm that everything went OK you can do two things:
For instructions on how to run a stunnel service without cygwin read this.
Extras
If you want to create a demon stunnel service you will need to specify
the location of your certificate (stunnel.pem) , but much more important you
MUST create YOUR OWN certificate.
Download the mk_stunnel_cert.sh file containing:
#START
#!/bin/sh
# Generate a new ssl certificate 'stunnel.pem' in the current directory
openssl req -new -nodes -out required.pem -keyout private.pem
openssl rsa -in private.pem -out new.private.pem
openssl x509 -in required.pem -out ca-cert -req -signkey new.private.pem -days 365
openssl gendh > diffie_hellman
cat ca-cert >> new.private.pem
cat diffie_hellman >> new.private.pem
cp new.private.pem stunnel.pem
#FINISH
In the same directory, at Cygwin/Bash prompt type:
# ./mk_stunnel_cert.sh
This will create a new stunnel.pem in the current directory, you should now move it to the same directory where you dropped the stunnel.exe file.
Copyright © 2001 Giuseppe J. Crisafulli. All rights reserved.
Revised: 02/26/02.