Skip to content

tls_wolfssl: use a client method for client-only domains - #4529

Open
Th0masL wants to merge 1 commit into
OpenSIPS:masterfrom
Th0masL:fix/wolfssl-client-domain-method
Open

Th0masL wants to merge 1 commit into
OpenSIPS:masterfrom
Th0masL:fix/wolfssl-client-domain-method

Conversation

@Th0masL

@Th0masL Th0masL commented Dec 3, 2026

Copy link
Copy Markdown

Summary

Use wolfSSLv23_client_method() when initializing client-only TLS domains.

This fixes outbound TLS handshakes to ECDSA-only peers with wolfSSL 5.6.6, bundled by OpenSIPS 3.6. This PR is intended for merging into master followed by a backport to 3.6.

Details

Currently, client domains use the generic wolfSSLv23_method(). With wolfSSL 5.6.6, subsequently calling wolfSSL_set_connect_state() does not fully rebuild the cipher suites and signature algorithms for client use.

A standalone harness reproducing the module's client initialization and connection setup reproduces handshake failures with ECDSA-only servers on both TLS 1.2 and TLS 1.3, returning error -313 (received fatal alert). RSA-server handshakes succeed.

Master's bundled wolfSSL 5.9.1 already handles these handshakes successfully with either method. The demonstrated bug-fix benefit is therefore for 3.6; on master, the change explicitly selects the appropriate client API.

Solution

Select wolfSSLv23_client_method() when DOM_FLAG_CLI is set and DOM_FLAG_SRV is not set. All other domains retain the existing generic method.

This initializes client cipher suites and signature algorithms correctly from the start, without relying on a later role switch to rebuild them.

Validation using the standalone harness:

wolfSSL Server certificate Generic method Client method
5.6.6 ECDSA Fails on TLS 1.2 and 1.3 Both pass
5.6.6 RSA Both pass Both pass
5.9.1 ECDSA Both pass Both pass
5.9.1 RSA Both pass Both pass

The patched tls_wolfssl module also compiled and linked successfully against master's pinned wolfSSL dependency.

Limitations: handshake validation used a standalone library harness, not a full OpenSIPS integration test. Tests ran on Linux ARM64. wolfSSL 5.4.0, bundled by older OpenSIPS branches, was not tested.

Compatibility

No configuration migration is required. Server-domain initialization and subsequent protocol-version configuration are unchanged.

No regressions were observed in the tested handshake cases, including cases with and without a configured client certificate and with explicit minimum/maximum TLS versions. No SIP signaling behavior is changed.

Please consider backporting this change to 3.6.

Closing issues

None.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant