File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -131,21 +131,21 @@ bool InfluxDBClient::init() {
131131 if (https) {
132132#if defined(ESP8266)
133133 BearSSL::WiFiClientSecure *wifiClientSec = new BearSSL::WiFiClientSecure;
134- if (_certInfo && strlen_P (_certInfo) > 0 ) {
134+ if (_insecure) {
135+ wifiClientSec->setInsecure ();
136+ } else if (_certInfo && strlen_P (_certInfo) > 0 ) {
135137 if (strlen_P (_certInfo) > 60 ) { // differentiate fingerprint and cert
136138 _cert = new BearSSL::X509List (_certInfo);
137139 wifiClientSec->setTrustAnchors (_cert);
138140 } else {
139141 wifiClientSec->setFingerprint (_certInfo);
140142 }
141143 }
142- if (_insecure) {
143- wifiClientSec->setInsecure ();
144- }
144+
145145 checkMFLN (wifiClientSec, _serverUrl);
146146#elif defined(ESP32)
147147 WiFiClientSecure *wifiClientSec = new WiFiClientSecure;
148- if (_certInfo && strlen_P (_certInfo) > 0 ) {
148+ if (!_insecure && _certInfo && strlen_P (_certInfo) > 0 ) {
149149 wifiClientSec->setCACert (_certInfo);
150150 }
151151#endif
You can’t perform that action at this time.
0 commit comments