dev.20, fixes #3064, handling of optional gpios

This commit is contained in:
MichaelDvP
2026-05-07 12:02:33 +02:00
parent 764c660b14
commit ae5beccb9d
11 changed files with 314 additions and 268 deletions

View File

@@ -185,10 +185,14 @@ bool MqttSettingsService::configureMqtt() {
#ifndef TASMOTA_SDK
if (_state.enableTLS) {
if (_state.rootCA == "insecure") {
#if defined(EMSESP_DEBUG)
emsesp::EMSESP::logger().debug("Start insecure MQTT");
#endif
static_cast<espMqttClientSecure *>(_mqttClient)->setInsecure();
} else {
#if defined(EMSESP_DEBUG)
emsesp::EMSESP::logger().debug("Start secure MQTT with rootCA");
#endif
String certificate = "-----BEGIN CERTIFICATE-----\n" + _state.rootCA + "\n-----END CERTIFICATE-----\n";
static_cast<espMqttClientSecure *>(_mqttClient)->setCACert(certificate.c_str());
}