Improved MQTT SSL

This commit is contained in:
Gunnar Skjold
2023-10-12 18:44:40 +02:00
parent 2a10096306
commit f9b4680b9c
8 changed files with 165 additions and 52 deletions

View File

@@ -1866,8 +1866,10 @@ void MQTT_connect() {
if(mqttSecureClient->loadCACert(file, file.size())) {
debugI_P(PSTR("CA accepted"));
} else {
debugW_P(PSTR("CA was rejected, disabling certificate validation"));
mqttSecureClient->setInsecure();
debugW_P(PSTR("CA was rejected"));
delete mqttSecureClient;
mqttSecureClient = NULL;
return;
}
#endif
file.close();