The following has been tested with Stunnel4 on Debian and Ubuntu.

To use an intermediate certificate with Stunnel you can simply combine the key, SSL certificate and intermediate certificate into a single file. Important is that you use the right order (key, certificate, intermediate certifcate) or it won’t work.

cat certificate.key certificate.pem intermediate.pem > stunnel.pem<br></br>

Then specify the file in your stunnel config file, e.g. /etc/stunnel/stunnel.conf.

cert = /etc/stunnel/stunnel.pem<br></br>

You do not need to add a key or CAfile value to your configuration file. You can check at if your certificate is working properly.