I'm currently working on MQTTs using ESP-IDF on eclipse with the ESP-IDF plugin. My goal is to adapt an existing c++ library made for POSIX to ESP32. The library currently uses PAHO and I want to replace it with the native esp32 MQTT library. And I'm currently trying the MQTTs example called ssl_mutual_auth.
For the broker, I have a test RabbitMQ and I am using self-signed certificates. Those certificates work well with the existing library using PAHO. But to make this work since it's a test installation without any hostname, just an IP and test self-signed certificate, I need to disable the hostname verification (verify that the certificate matches the given host name). Here is the documentation of that function in PAHOc++ :https://eclipse.github.io/paho.mqtt.c/M ... 2931f573ce
Right now it seems that the MQTT client (the esp32) does not accept to connect to the MQTT broker (rabbitMQ) due to this hostname verification.
Is it possible to disable this hostname verification the same way it is done in PAHO?
MQTTs - disable hostname verification
Re: MQTTs - disable hostname verification
Maybe this thread could help you: How to use MQTT with SSL/TLS without using a certificate
Re: MQTTs - disable hostname verification
Yes, you can set skip_cert_common_name_check(https://github.com/espressif/esp-mqtt/b ... ent.h#L260) to true to skip check server hostname in CA.
-
- Posts: 2
- Joined: Thu Jan 19, 2023 3:14 pm
Re: MQTTs - disable hostname verification
Thanks, it's exactly what I needed, tested and it is working as expected.ESP_YJM wrote: Yes, you can set skip_cert_common_name_check(https://github.com/espressif/esp-mqtt/b ... ent.h#L260) to true to skip check server hostname in CA.