https using stunnel


Quick guide based on stunnel for mysql - server and client to add https to existing http server on demand.



Installation

apt-get install stunnel4

Create certificate

cd /etc/stunnel
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout https.pem -out https.pem

Configuration file

/etc/stunnel/httpd.conf

cert = /etc/stunnel/https.pem
sslVersion = SSLv3
debug = 7

[https]
accept  = 443
connect = 80
TIMEOUTclose = 0

Start tunnel

stunnel4 /etc/stunnel/https.conf