My company uses a MQTT server for internal tests that uses SSL without certificates, so in order to connect to it i would need to configure my esp for doing the same, i tested on arduino IDE and i can connect to my company's server using the library WiFiClientSecure.h , but i'm starting a new project and want to implement that on ESP-IDF.
I already tested MQTT on ESP-IDF without SSL/TLS on shiftr.io/try using the simplest implementation i could and it's working just fine, after that i changed to my company's server info and the code looks like this:
Code: Select all
esp_mqtt_client_config_t mqtt_cfg = {0};
mqtt_cfg.host = "xxxxx";
mqtt_cfg.port = 8883;
mqtt_cfg.username = "xxxx";
mqtt_cfg.password = "xxxxxx";
mqtt_cfg.client_id = "IDF";
esp_mqtt_client_handle_t client=esp_mqtt_client_init(&mqtt_cfg);
esp_mqtt_client_start(client);
esp_mqtt_client_publish(client,"/teste/idf", "Testei", 6, 0, 0);
i tried writing "mqtt_cfg.transport=MQTT_TRANSPORT_OVER_SSL;" (stops showing error message but still fails to publish anything) or changing configurations on menuconfig , but none of that worked, also the documentation on ESP-IDF webpage says something about having a "bool use_secure_element" on config struct, but when i checked the library it wasn't there, does anybody know how can i enable SSL/TLS without using certificates?