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
10 openssl req -new -x509 -days 9999 -nodes -out stunnel.pem -keyout stunnel.pem
11 # see http://www.infodrom.org/Debian/tips/stunnel.html
12 dd if=/dev/urandom count=2 | openssl dhparam -rand - 1024 >> stunnel.pem
13 openssl x509 -text -in stunnel.pem
16 cat <<EOD>stunnel.conf
17 cert = /home/fex/etc/stunnel.pem
21 execargs = perl -T /home/fex/bin/fexsrv stunnel
24 case $(lsb_release -a 2>/dev/null) in
25 *CentOS*) echo 'fips = no' >>stunnel.conf;;
30 stunnel=$(which stunnel4)
31 if [ -z "$stunnel" ]; then
32 echo "no stunnel found" >&2
35 cat <<EOD>/etc/xinetd.d/fexs
37 # description: fex web server with SSL
38 # note: only possible on port 443!
50 server_args = /home/fex/etc/stunnel.conf
56 /etc/init.d/xinetd restart
57 echo 'To enforce https, add to fex.ph:'
58 echo '$force_https = 1;'
62 # Hint: on some systems stunnel works not well with xinetd
63 # you can also run stunnel without xinetd, in server daemon mode