1 # http://www.stunnel.org/faq/certs.html
3 # execute this as root!
8 openssl req -new -x509 -days 9999 -nodes -out stunnel.pem -keyout stunnel.pem
9 # see http://www.infodrom.org/Debian/tips/stunnel.html
10 dd if=/dev/urandom count=2 | openssl dhparam -rand - 1024 >> stunnel.pem
11 openssl x509 -text -in stunnel.pem
14 cat <<EOD>stunnel.conf
15 cert = /home/fex/etc/stunnel.pem
19 execargs = perl -T /home/fex/bin/fexsrv stunnel
22 case $(lsb_release -a 2>/dev/null) in
23 *CentOS*) echo 'fips = no' >>stunnel.conf;;
28 stunnel=$(which stunnel4)
29 if [ -z "$stunnel" ]; then
30 echo "no stunnel found" >&2
33 cat <<EOD>/etc/xinetd.d/fexs
35 # description: fex web server with SSL
36 # note: only possible on port 443!
48 server_args = /home/fex/etc/stunnel.conf
54 /etc/init.d/xinetd restart
55 echo 'To enforce https, add to fex.ph:'
56 echo '$force_https = 1;'
60 # Hint: on some systems stunnel works not well with xinetd
61 # you can also run stunnel without xinetd, in server daemon mode