Stunnel can run multiple ips and certs in one instance

Apparently only the newer versions can do this, 4.15+, but the concept is simple:

setuid          = stunnel
setgid          = stunnel
debug           = 5
output          = /var/log/stunnel/stunnel.log
pid             = /var/run/stunnel/
socket          = l:TCP_NODELAY=1
ciphers         = ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:!LOW:!SSLv2:!EXP:!eNULL
options         = NO_SSLv2

accept          =
cert            = /etc/pki/tls/certs/site1.pem
connect         =
TIMEOUTclose    = 0

accept          =
cert            = /etc/pki/tls/certs/site2.pem
connect         =
TIMEOUTclose    = 0

This is much better than running multiple instances of stunnel.

For what it’s worth, if you enable a log file, it’ll turn off sys logging, which is critical for extreme performance. Keep the debug level low. For https, disable v2 and set the cipher list the right way.