Skip to content

Conversation

@newTomas
Copy link

@newTomas newTomas commented Jan 7, 2026

This PR adds several improvements to the stunnel plugin:

  1. Add all missing protocols - Added cifs, capwin, capwinctrl, connect, pgsql, proxy, socks protocols from stunnel documentation.

  2. Add OCSP AIA toggle - New checkbox to enable OCSP certificate verification.

  3. 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.


[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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants