security/stunnel: Add missing protocols, OCSP toggle, fix service status#5124
security/stunnel: Add missing protocols, OCSP toggle, fix service status#5124newTomas wants to merge 7 commits intoopnsense:masterfrom
Conversation
security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf
Outdated
Show resolved
Hide resolved
|
|
||
| [status] | ||
| command:/usr/local/etc/rc.d/stunnel status; /usr/local/etc/rc.d/identd_stunnel onestatus; exit 0 | ||
| command:/usr/local/etc/rc.d/stunnel status; exit 0 |
There was a problem hiding this comment.
if there's an issue with the status call, this probably isn't the place to fix it (as it will ignore the identd process in full now).
There was a problem hiding this comment.
As I understand it, the check takes place in the base class
/usr/local/opnsense/mvc/app/controllers/OPNsense/Base/ApiMutableServiceControllerBase.php:
if (strpos($response, 'not running') > 0) {
if ($this->serviceEnabled()) {
$status = 'stopped';
} else {
$status = 'disabled';
}
} elseif (strpos($response, 'is running') > 0) {
$status = 'running';
} elseif (!$this->serviceEnabled()) {
$status = 'disabled';
} else {
$status = 'unknown';
}By default, the ident is disabled, which is why the status command returns:
stunnel is running as pid 78451.
identd_stunnel is not running.
The code first searches for the string 'not running' and sets the status to 'stopped'
Ideally, the stunnel and ident status should be displayed separately, but I suspect you'll have to change the OPNsense base class to do this. Correct me if I'm wrong.
There was a problem hiding this comment.
the question is not which line to change but which output we expect. A single service status should return a single line IMO even though that's not always the case. We can mask one status line or filter for the backend to see the right thing.
security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml
Outdated
Show resolved
Hide resolved
…empty Co-authored-by: Ad Schellevis <AdSchellevis@users.noreply.github.com>
security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/general.xml
Outdated
Show resolved
Hide resolved
…nnel/forms/general.xml
This PR adds several improvements to the stunnel plugin:
Add all missing protocols - Added cifs, capwin, capwinctrl, connect, pgsql, proxy, socks protocols from stunnel documentation.
Add OCSP AIA toggle - New checkbox to enable OCSP certificate verification.
Fix service status detection - Status check was incorrectly reporting "stopped" when identd_stunnel was not running, even if main stunnel service was running. Fixed by checking only main stunnel service status.