Skip to content

Implemented custom SNI server name - #1582

Open
fpagliughi wants to merge 2 commits into
eclipse-paho:developfrom
fpagliughi:custom-sni-validation
Open

Implemented custom SNI server name#1582
fpagliughi wants to merge 2 commits into
eclipse-paho:developfrom
fpagliughi:custom-sni-validation

Conversation

@fpagliughi

Copy link
Copy Markdown
Contributor

This implements #1580, to provide an optional, separate SNI server name.

It adds a new const char* serverName parameter to the SSL options. If it is non-NULL, then it is used for SNI validation, otherwise the host name is used. Thus the new capability is opt-in, and defaults to the previous implementation if not provided, and therefore is completely backward compatible.

@fpagliughi
fpagliughi force-pushed the custom-sni-validation branch from 1a9ca71 to edf5f76 Compare March 1, 2025 15:49
@fpagliughi

fpagliughi commented Mar 1, 2025

Copy link
Copy Markdown
Contributor Author

It took two tries, but this appears to be working now and passing all the unit tests.

The simplest test for this is to use the IP address in the URL and then set the serverName in the SSL options to the host name, and verify enabled like:

URL -> mqtts://5.196.78.28:8886
serverName -> test.mosquitto.org
verify -> 1

A thing to note is that this only allows for providing a single server name, even when using High Availability with multiple URLs. If you omit the server name, each host name will be derived from the URL, just like before, but if you do add a server name, all addresses will verify to that name.

@icraggs icraggs linked an issue Aug 12, 2025 that may be closed by this pull request
@icraggs icraggs modified the milestones: 1.3.15, 1.4.0 Aug 12, 2025
@icraggs
icraggs changed the base branch from develop to 1.4 February 12, 2026 17:01
@icraggs
icraggs changed the base branch from 1.4 to develop February 12, 2026 17:02
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.

Custom SNI validation

2 participants