From 2730df65c2c5a948daca8df2b7ccc05f3615cb94 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sun, 8 May 2022 17:33:11 +0200 Subject: [PATCH] Disable auto-TLS for port 8883 --- tasmota/settings.ino | 4 ++++ tasmota/xdrv_02_9_mqtt.ino | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tasmota/settings.ino b/tasmota/settings.ino index b0fefb41b..1d03c5c0e 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -1487,6 +1487,10 @@ void SettingsDelta(void) { ParseIPv4(&Settings->ipv4_rgx_subnetmask, PSTR(WIFI_RGX_SUBNETMASK)); SettingsUpdateText(SET_RGX_SSID, PSTR(WIFI_RGX_SSID)); SettingsUpdateText(SET_RGX_PASSWORD, PSTR(WIFI_RGX_PASSWORD)); + if ((8883 == Settings->mqtt_port) || (8884 == Settings->mqtt_port) || (443 == Settings->mqtt_port)) { + // Turn on TLS for port 8883 (TLS), 8884 (TLS, client certificate), 443 (TLS, user/password) + Settings->flag4.mqtt_tls = true; + } } if (Settings->version < 0x09050007) { #ifdef DISABLE_REFERER_CHK diff --git a/tasmota/xdrv_02_9_mqtt.ino b/tasmota/xdrv_02_9_mqtt.ino index 3bafcc56f..5cec32eb6 100644 --- a/tasmota/xdrv_02_9_mqtt.ino +++ b/tasmota/xdrv_02_9_mqtt.ino @@ -202,10 +202,6 @@ void MqttInit(void) { #endif //USE_MQTT_AZURE_IOT #ifdef USE_MQTT_TLS bool aws_iot_host = false; - if ((8883 == Settings->mqtt_port) || (8884 == Settings->mqtt_port) || (443 == Settings->mqtt_port)) { - // Turn on TLS for port 8883 (TLS), 8884 (TLS, client certificate), 443 (TLS, user/password) - Settings->flag4.mqtt_tls = true; - } Mqtt.mqtt_tls = Settings->flag4.mqtt_tls; // this flag should not change even if we change the SetOption (until reboot) // Detect AWS IoT and set default parameters