fix crash when using encrypted connection

This commit is contained in:
technyon
2023-01-28 21:59:35 +01:00
parent daba25657e
commit b11a3329f8
3 changed files with 6 additions and 6 deletions

View File

@@ -18,9 +18,9 @@ WifiDevice::WifiDevice(const String& hostname, Preferences* _preferences)
size_t crtLength = _preferences->getString(preference_mqtt_crt,_cert,TLS_CERT_MAX_SIZE);
size_t keyLength = _preferences->getString(preference_mqtt_key,_key,TLS_KEY_MAX_SIZE);
_useEncryption = caLength > 1;
_useEncryption = caLength > 1; // length is 1 when empty
if(_useEncryption > 1) // length is 1 when empty
if(_useEncryption)
{
Log->println(F("MQTT over TLS."));
Log->println(_ca);