1 # http://www.stunnel.org/faq/certs.html
3 # execute this as root!
5 # Redhat : stunnel-4 does not work! you need to install stunnel-5
6 # Debian : stunnel-5.06 does not work! you need to install stunnel-5.18
11 openssl req -new -x509 -days 9999 -nodes -out stunnel.pem -keyout stunnel.pem
12 # see http://www.infodrom.org/Debian/tips/stunnel.html
13 dd if=/dev/urandom count=2 | openssl dhparam -rand - 1024 >> stunnel.pem
14 openssl x509 -text -in stunnel.pem
17 cat <<EOD>stunnel.conf
18 cert = /home/fex/etc/stunnel.pem
22 execargs = perl -T /home/fex/bin/fexsrv stunnel
25 case $(lsb_release -a 2>/dev/null) in
26 *CentOS*) echo 'fips = no' >>stunnel.conf;;
31 stunnel=$(which stunnel4)
32 if [ -z "$stunnel" ]; then
33 echo "no stunnel found" >&2
36 cat <<EOD>/etc/xinetd.d/fexs
38 # description: fex web server with SSL
39 # note: only possible on port 443!
51 server_args = /home/fex/etc/stunnel.conf
57 /etc/init.d/xinetd restart
58 echo 'To enforce https, add to fex.ph:'
59 echo '$force_https = 1;'
63 # Hint: on some systems stunnel works not well with xinetd
64 # you can also run stunnel without xinetd, in server daemon mode