<div dir="ltr">This patch doesn't allow for multiple [service] lines. To use it, you must configure only one Listen= in your .socket file, and that one fd will be passed to stunnel, which must have only one [service].<div>

<br></div><div>I'm happy to work on allowing multiple fds to be passed from systemd to stunnel, if the patch will be accepted. What should the syntax be? Systemd simply passed through a file descriptor for each socket it's listening on, keeping the same order they're declared in the .socket. E.g.:</div>

<div><br></div><div>### stunnel.socket</div><div><br></div><div><font face="courier new, monospace">ListenStream=9999</font></div><div><font face="courier new, monospace">ListenStream=9998</font></div><div><br></div><div>

### stunnel.conf</div><div><br></div><div><font face="courier new, monospace">[foo service]</font></div><div><font face="courier new, monospace">accept=9999</font></div><div><font face="courier new, monospace"><br></font></div>

<div><font face="courier new, monospace">[bar service]</font></div><div><font face="courier new, monospace">accept=9998</font></div><div><br></div><div>We can just enforce a rule that your services must be in the same order as the ListenStream= declarations. With the above configuration, a user could either start the stunnel service using `systemctl start stunnel.service` or `systemctl start stunnel.socket` and either must work without modification to stunnel.conf.</div>

<div><br></div><div>- Mark</div><div><br></div><div><br></div></div>