Add mqtt_secure connection condition for logging (#1082)
* Add mqtt_secure connection condition when logging SSL error status
This commit is contained in:
1 parent
36f4f89fbb
commit
dbedcf065d
1 file changed
+4
-2
+4
-2
@@ -530,9 +530,11 @@ void connectMQTT() {
|
|||||||
Log.warning(F("failure_number_mqtt: %d" CR), failure_number_mqtt);
|
Log.warning(F("failure_number_mqtt: %d" CR), failure_number_mqtt);
|
||||||
Log.warning(F("failed, rc=%d" CR), client.state());
|
Log.warning(F("failed, rc=%d" CR), client.state());
|
||||||
#if defined(ESP32)
|
#if defined(ESP32)
|
||||||
Log.warning(F("failed, ssl error code=%d" CR), ((WiFiClientSecure*)eClient)->lastError(nullptr, 0));
|
if (mqtt_secure)
|
||||||
|
Log.warning(F("failed, ssl error code=%d" CR), ((WiFiClientSecure*)eClient)->lastError(nullptr, 0));
|
||||||
#elif defined(ESP8266)
|
#elif defined(ESP8266)
|
||||||
Log.warning(F("failed, ssl error code=%d" CR), ((WiFiClientSecure*)eClient)->getLastSSLError());
|
if (mqtt_secure)
|
||||||
|
Log.warning(F("failed, ssl error code=%d" CR), ((WiFiClientSecure*)eClient)->getLastSSLError());
|
||||||
#endif
|
#endif
|
||||||
digitalWrite(LED_ERROR, LED_ERROR_ON);
|
digitalWrite(LED_ERROR, LED_ERROR_ON);
|
||||||
delay(2000);
|
delay(2000);
|
||||||
|
|||||||
Reference in new issue
Block a user