diff --git a/main/main.ino b/main/main.ino index ee9242342a..6b2229657a 100644 --- a/main/main.ino +++ b/main/main.ino @@ -1951,7 +1951,7 @@ void MQTTtoSYS(char* topicOri, JsonObject& SYSdata) { // json object decoding } # if MQTT_SECURE_SELF_SIGNED if (use_ss_cert) { - cert_index = SYSdata.get("mqtt_cert_index"); + cert_index = SYSdata["mqtt_cert_index"].as(); if (cert_index >= sizeof(certs_array) / sizeof(ss_certs)) { Log.error(F("mqtt_cert_index invalid - ignoring command" CR)); return; diff --git a/platformio.ini b/platformio.ini index 295cda9870..2e6aa83901 100644 --- a/platformio.ini +++ b/platformio.ini @@ -859,6 +859,7 @@ lib_deps = build_flags = ${com-esp.build_flags} '-DMQTT_HTTPS_FW_UPDATE' + '-DMQTT_SECURE_SELF_SIGNED' '-DGateway_Name="OpenMQTTGateway_TEST_MQTT_FW"' board_build.flash_mode = dout