-
Notifications
You must be signed in to change notification settings - Fork 8k
Labels
area: NetworkingbugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bug
Description
Describe the bug
In the documentation for mqtt_sec_config it says hostname
"May be NULL to skip hostname verification".
The code that turns that configuration into a TLS_HOSTNAME
socket option just skips setting the option if hostname
is NULL. This leaves TLS_HOSTNAME
set to its default value, an empty string, and causes certificate validation to fail.
It looks like TLS_HOSTNAME
defaulting to an empty string was a decision made when TLS socket options were implemented.
Regression
- This is a regression.
Steps to reproduce
- Build the net/secure_mqtt_sensor_actuator sample without
CONFIG_MBEDTLS_SERVER_NAME_INDICATION
- Observer that certificate validation fails because the certificate name does not match the hostname
Relevant log output
Impact
Functional Limitation – Some features not working as expected, but system usable.
Environment
- OS: Linux
- SDK: zephyr-sdk-0.16.5
- Zephyr version: both 3.7.1 and current main
Additional Context
No response
Metadata
Metadata
Labels
area: NetworkingbugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bug