diff --git a/html/test.htm b/html/test.htm index 4d10371..8648b6c 100644 --- a/html/test.htm +++ b/html/test.htm @@ -148,6 +148,8 @@ appendLog( "Push target 'mqtt' failed with error timeout" ); else if(code==-10) appendLog( "Push target 'mqtt' failed with error denied" ); + else if(code==-100) + appendLog( "Push target 'mqtt' skipped since it's using SSL" ); else appendLog( "Push target 'mqtt' failed with error code " + code ); } @@ -177,6 +179,8 @@ appendLog( "Push target 'influxdb' failed with error code 401, unauthorized" ); else if(code==404) appendLog( "Push target 'influxdb' failed with error code 404, url not found" ); + else if(code==-100) + appendLog( "Push target 'influxdb' skipped since it's using SSL" ); else appendLog( "Push target 'influxdb' failed with error code " + code ); } @@ -206,6 +210,8 @@ appendLog( "Push target '" + target + "' failed with error code 401, unauthorized" ); else if(code==404) appendLog( "Push target '" + target + "' failed with error code 404, url not found" ); + else if(code==-100) + appendLog( "Push target '" + target + "' skipped since it's using SSL" ); else appendLog( "Push target '" + target + "' failed with error code " + code ); } diff --git a/html/test.min.htm b/html/test.min.htm index a5a89a5..f9caac6 100644 --- a/html/test.min.htm +++ b/html/test.min.htm @@ -1 +1 @@ -Beer Gravity Monitor

Press test button to start testing all defined push targets.
(C) Copyright 2021-22 Magnus Persson
\ No newline at end of file +Beer Gravity Monitor

Press test button to start testing all defined push targets.
(C) Copyright 2021-22 Magnus Persson
\ No newline at end of file diff --git a/src/pushtarget.cpp b/src/pushtarget.cpp index 524a270..f083e76 100644 --- a/src/pushtarget.cpp +++ b/src/pushtarget.cpp @@ -204,10 +204,13 @@ void PushTarget::sendInfluxDb2(TemplatingEngine& engine, bool isSecure) { String auth = "Token " + String(myConfig.getInfluxDb2PushToken()); if (isSecure) { +#if defined( ESP8266 ) if (runMode == RunMode::configurationMode) { Log.notice(F("PUSH: Skipping InfluxDB since SSL is enabled and we are in config mode." CR)); + _lastCode = -100; return; } +#endif Log.notice(F("PUSH: InfluxDB, SSL enabled without validation." CR)); _wifiSecure.setInsecure(); @@ -290,10 +293,13 @@ void PushTarget::sendHttpPost(TemplatingEngine& engine, bool isSecure, #endif if (isSecure) { +#if defined( ESP8266 ) if (runMode == RunMode::configurationMode) { Log.notice(F("PUSH: Skipping HTTP since SSL is enabled and we are in config mode." CR)); + _lastCode = -100; return; } +#endif Log.notice(F("PUSH: HTTP, SSL enabled without validation." CR)); _wifiSecure.setInsecure(); @@ -364,10 +370,13 @@ void PushTarget::sendHttpGet(TemplatingEngine& engine, bool isSecure) { #endif if (isSecure) { +#if defined( ESP8266 ) if (runMode == RunMode::configurationMode) { Log.notice(F("PUSH: Skipping HTTP since SSL is enabled and we are in config mode." CR)); + _lastCode = -100; return; } +#endif Log.notice(F("PUSH: HTTP, SSL enabled without validation." CR)); _wifiSecure.setInsecure(); @@ -415,10 +424,13 @@ void PushTarget::sendMqtt(TemplatingEngine& engine, bool isSecure) { int port = myConfig.getMqttPort(); if (myConfig.isMqttSSL()) { +#if defined( ESP8266 ) if (runMode == RunMode::configurationMode) { Log.notice(F("PUSH: Skipping MQTT since SSL is enabled and we are in config mode." CR)); + _lastCode = -100; return; } +#endif Log.notice(F("PUSH: MQTT, SSL enabled without validation." CR)); _wifiSecure.setInsecure();