Added error code -100

This commit is contained in:
Magnus Persson 2022-04-29 08:59:37 +02:00
parent 56cd730ad4
commit 891794af7c
3 changed files with 19 additions and 1 deletions

View File

@ -148,6 +148,8 @@
appendLog( "Push target 'mqtt' failed with error timeout" ); appendLog( "Push target 'mqtt' failed with error timeout" );
else if(code==-10) else if(code==-10)
appendLog( "Push target 'mqtt' failed with error denied" ); appendLog( "Push target 'mqtt' failed with error denied" );
else if(code==-100)
appendLog( "Push target 'mqtt' skipped since it's using SSL" );
else else
appendLog( "Push target 'mqtt' failed with error code " + code ); appendLog( "Push target 'mqtt' failed with error code " + code );
} }
@ -177,6 +179,8 @@
appendLog( "Push target 'influxdb' failed with error code 401, unauthorized" ); appendLog( "Push target 'influxdb' failed with error code 401, unauthorized" );
else if(code==404) else if(code==404)
appendLog( "Push target 'influxdb' failed with error code 404, url not found" ); 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 else
appendLog( "Push target 'influxdb' failed with error code " + code ); appendLog( "Push target 'influxdb' failed with error code " + code );
} }
@ -206,6 +210,8 @@
appendLog( "Push target '" + target + "' failed with error code 401, unauthorized" ); appendLog( "Push target '" + target + "' failed with error code 401, unauthorized" );
else if(code==404) else if(code==404)
appendLog( "Push target '" + target + "' failed with error code 404, url not found" ); 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 else
appendLog( "Push target '" + target + "' failed with error code " + code ); appendLog( "Push target '" + target + "' failed with error code " + code );
} }

File diff suppressed because one or more lines are too long

View File

@ -204,10 +204,13 @@ void PushTarget::sendInfluxDb2(TemplatingEngine& engine, bool isSecure) {
String auth = "Token " + String(myConfig.getInfluxDb2PushToken()); String auth = "Token " + String(myConfig.getInfluxDb2PushToken());
if (isSecure) { if (isSecure) {
#if defined( ESP8266 )
if (runMode == RunMode::configurationMode) { if (runMode == RunMode::configurationMode) {
Log.notice(F("PUSH: Skipping InfluxDB since SSL is enabled and we are in config mode." CR)); Log.notice(F("PUSH: Skipping InfluxDB since SSL is enabled and we are in config mode." CR));
_lastCode = -100;
return; return;
} }
#endif
Log.notice(F("PUSH: InfluxDB, SSL enabled without validation." CR)); Log.notice(F("PUSH: InfluxDB, SSL enabled without validation." CR));
_wifiSecure.setInsecure(); _wifiSecure.setInsecure();
@ -290,10 +293,13 @@ void PushTarget::sendHttpPost(TemplatingEngine& engine, bool isSecure,
#endif #endif
if (isSecure) { if (isSecure) {
#if defined( ESP8266 )
if (runMode == RunMode::configurationMode) { if (runMode == RunMode::configurationMode) {
Log.notice(F("PUSH: Skipping HTTP since SSL is enabled and we are in config mode." CR)); Log.notice(F("PUSH: Skipping HTTP since SSL is enabled and we are in config mode." CR));
_lastCode = -100;
return; return;
} }
#endif
Log.notice(F("PUSH: HTTP, SSL enabled without validation." CR)); Log.notice(F("PUSH: HTTP, SSL enabled without validation." CR));
_wifiSecure.setInsecure(); _wifiSecure.setInsecure();
@ -364,10 +370,13 @@ void PushTarget::sendHttpGet(TemplatingEngine& engine, bool isSecure) {
#endif #endif
if (isSecure) { if (isSecure) {
#if defined( ESP8266 )
if (runMode == RunMode::configurationMode) { if (runMode == RunMode::configurationMode) {
Log.notice(F("PUSH: Skipping HTTP since SSL is enabled and we are in config mode." CR)); Log.notice(F("PUSH: Skipping HTTP since SSL is enabled and we are in config mode." CR));
_lastCode = -100;
return; return;
} }
#endif
Log.notice(F("PUSH: HTTP, SSL enabled without validation." CR)); Log.notice(F("PUSH: HTTP, SSL enabled without validation." CR));
_wifiSecure.setInsecure(); _wifiSecure.setInsecure();
@ -415,10 +424,13 @@ void PushTarget::sendMqtt(TemplatingEngine& engine, bool isSecure) {
int port = myConfig.getMqttPort(); int port = myConfig.getMqttPort();
if (myConfig.isMqttSSL()) { if (myConfig.isMqttSSL()) {
#if defined( ESP8266 )
if (runMode == RunMode::configurationMode) { if (runMode == RunMode::configurationMode) {
Log.notice(F("PUSH: Skipping MQTT since SSL is enabled and we are in config mode." CR)); Log.notice(F("PUSH: Skipping MQTT since SSL is enabled and we are in config mode." CR));
_lastCode = -100;
return; return;
} }
#endif
Log.notice(F("PUSH: MQTT, SSL enabled without validation." CR)); Log.notice(F("PUSH: MQTT, SSL enabled without validation." CR));
_wifiSecure.setInsecure(); _wifiSecure.setInsecure();