Hello,
We are currently using the initial MicroEJ port for ESP32.
After upgrading to ESP-IDF 5.5.4, we noticed that the SSL implementation used by MicroEJ (ESP-IDF + C port) has never been validating the server certificate’s common name / hostname.
(woops…)
Some context:
- With older versions of ESP-IDF / mbedTLS, it was possible to complete the SSL handshake without explicitly setting or verifying the hostname. This results in an insecure connection, since only the certificate authority and basic checks are performed.
- In newer versions, this is no longer acceptable. As described here: CVE-2025-27809 FAQ — Mbed TLS documentation , hostname verification is now a required part of a secure TLS setup, otherwise the connection cannot be considered safe.
What we need to do:
- As stated in the mbedTLS documentation, mbedtls_ssl_set_hostname() must be called before mbedtls_ssl_handshake().
The issue we are facing:
- In the MicroEJ C API, we are unable to find any way to pass or configure the hostname for the SSL context.
Note:
- The call to mbedtls_ssl_handshake() is performed inside LLNET_SSL_SOCKET_IMPL_initialHandShake() located in components/microej/ssl/src/LLNET_SSL_SOCKET_impl.c.
Has anyone already dealt with this in a MicroEJ + ESP-IDF integration, or found a proper way to inject the hostname into the SSL layer?
![]()