Auto enabled TLS if port is 443

This commit is contained in:
Stephan Hadinger 2021-08-16 14:20:10 +02:00
parent 8356126c30
commit f6eaa77f28
1 changed files with 2 additions and 2 deletions

View File

@ -197,8 +197,8 @@ void MqttInit(void) {
Settings->mqtt_port = 8883;
#endif //USE_MQTT_AZURE_IOT
#ifdef USE_MQTT_TLS
if ((8883 == Settings->mqtt_port) || (8884 == Settings->mqtt_port)) {
// Turn on TLS for port 8883 (TLS) and 8884 (TLS, client certificate)
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)