; Certificate/key is needed in server mode and optional in client mode cert = /etc/stunnel/cert.pem key = /etc/stunnel/key.pem ; Protocol version (all, SSLv2, SSLv3, TLSv3) sslVersion = TLSv1.3 ;ciphers = EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+aRSA+RC4:EDH+aRSA:EECDH:DES-CBC3-SHA:AES:CAMELLIA:!aNULL:!eNULL:!LOW:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!EDH:!DES:!3DES ; Some security enhancements ;chroot = /var/lib/stunnel4/ setuid = stunnel4 setgid = stunnel4 pid = /var/run/stunnel4/server.pid ; Some performance tunings socket = l:TCP_NODELAY=1 socket = r:TCP_NODELAY=1 ; Workaround for Eudora bug ;options = DONT_INSERT_EMPTY_FRAGMENTS ; Authentication stuff verify = 2 verifyChain = yes checkHost = hostsharing.net ; Don't forget to c_rehash CApath ; CApath is located inside chroot jail CApath = /etc/ssl/certs ; It's often easier to use CAfile ;CAfile = /etc/stunnel/certs.pem ; Don't forget to c_rehash CRLpath ; CRLpath is located inside chroot jail ;CRLpath = /crls ; Alternatively you can use CRLfile ;CRLfile = /etc/stunnel/crls.pem ; Some debugging stuff useful for troubleshooting debug = 0 output = /var/log/stunnel4/server.log ; Use it for client mode ;client = yes ; Service-level configuration [mysql] accept = 3307 connect = 127.0.0.1:3306 [pgsql] accept = 5433 connect = 127.0.0.1:5432