I just encountered this issue today.
I reinstalled the stunnel package and still was not able to launch stunnel.
I ssh-ed into my pfsense box and did
find / | grep stunnel
the result from the above command lead me to examine /usr/local/etc/rc.d/stunnel.sh
cat /usr/local/etc/rc.d/stunnel.sh
which returned
#!/bin/sh
# This file was automatically generated
# by the pfSense service handler.
rc_start() {
/usr/local/bin/stunnel /usr/local/etc/stunnel/stunnel.conf
}
rc_stop() {
killall stunnel
}
case $1 in
start)
rc_start
;;
stop)
rc_stop
;;
restart)
rc_stop
rc_start
;;
esac
This suggested that /usr/local/etc/stunnel/stunnel.conf is used as the configuration file so I followed with
cat /usr/local/etc/stunnel/stunnel.conf
to examine the file, which in turn showed
cert = /usr/local/etc/stunnel/stunnel.pem
chroot = /var/tmp/stunnel
setuid = stunnel
setgid = stunnel
Manually running the following on the command line
/usr/local/bin/stunnel /usr/local/etc/stunnel/stunnel.conf
confirmed that stunnel was exiting because there was no actual tunnel endpoints set up.
So I went back to the WebGUI under Services > Stunnel, and took a look at the Tunnels tab where I had 3 tunnel endpoints configured. I figured that clicking the edit button on each entry and then clicking the save button would repopulate the /usr/local/etc/stunnel/stunnel.conf file so I clicked 'edit' and subsequently 'save' for each of my tunnel endpoints.
As a precaution I navigated to the Certificates tab and did the same edit-save procedure for each of my three certificates.
I then went back to the command line and made sure my clicking around had an effect. I ran
cat /usr/local/etc/stunnel/stunnel.conf
and was glad to see that my clicking around the GUI wasn't in vain; the file was populated with configuration parameters defining my endpoints.
I then manually started stunnel from the commmand line with
/usr/local/bin/stunnel /usr/local/etc/stunnel/stunnel.conf
and my stunnel is up and running again (also shows green on the Status > Services section).
I haven't yet restarted the firewall and don't know if the solution will persist or not.
Best regards,
V