I have a HAProxy + stunnel setup, I would like to have different certificates for my domain and submdomain. Certificate 1 - example.com Certificate 2 - foo.example.com How do I configure Stunnel to do this? It works fine with just one certificate but I have trouble setting it up for multiple certificates. Thanks!

  • You run multiple instances of stunnel. AFAIK it doesn't do multiple certs.
    – Zoredache
    Apr 9, 2014 at 5:25

1 Answer 1


With one IP address, you need to use the TLS SNI extension. There's an example config here: https://serverfault.com/a/440563/216353

Server-side SNI requires stunnel version 4.38 or newer compiled with OpenSSL 1.0.0 or newer.

Also, client support:

  • IE7+
  • Chrome 6+
  • Firefox 2+
  • Opera 8+
  • Safari 3+
  • iOS4+

Also note that Windows XP does not support the SNI extension.

  • 2
    bennettp123, welcome to SF. That's a cracking, textbook first answer - +1 from me.
    – MadHatter
    Apr 14, 2014 at 10:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.