Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog
## 3.7.1 [in progress]
### Features
- [#143](https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino/pull/143) - `InfluxDBClient::setInsecure` now works also for ESP32. Requires Arduino ESP32 SDK 1.0.5 or higher

### Documentation
- [#134](https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino/pull/134):
- Added untrusted connection (skipping certificate validation) info to Readme
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ InfluxDBClient client(INFLUXDB_URL, INFLUXDB_ORG, INFLUXDB_BUCKET, INFLUXDB_TOKE

void setup() {
// Set insecure connection to skip server certificate validation
client.setInsecure(true);
client.setInsecure();
}
```

Expand Down
2 changes: 1 addition & 1 deletion examples/SecureBatchWrite/SecureBatchWrite.ino
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void setup() {
sensorStatus.addTag("SSID", WiFi.SSID());

// Alternatively, set insecure connection to skip server certificate validation
//client.setInsecure(true);
//client.setInsecure();

// Accurate time is necessary for certificate validation and writing in batches
// Syncing progress and the time will be printed to Serial.
Expand Down
2 changes: 1 addition & 1 deletion examples/SecureWrite/SecureWrite.ino
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void setup() {
sensor.addTag("SSID", WiFi.SSID());

// Alternatively, set insecure connection to skip server certificate validation
//client.setInsecure(true);
//client.setInsecure();

// Accurate time is necessary for certificate validation and writing in batches
// For the fastest time sync find NTP servers in your area: https://www.pool.ntp.org/zone/
Expand Down
12 changes: 8 additions & 4 deletions src/InfluxDbClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,17 @@ bool InfluxDBClient::init() {
wifiClientSec->setFingerprint(_certInfo);
}
}

checkMFLN(wifiClientSec, _serverUrl);
#elif defined(ESP32)
WiFiClientSecure *wifiClientSec = new WiFiClientSecure;
if(!_insecure && _certInfo && strlen_P(_certInfo) > 0) {
wifiClientSec->setCACert(_certInfo);
}
if (_insecure) {
#ifndef ARDUINO_ESP32_RELEASE_1_0_4
// This works only in ESP32 SDK 1.0.5 and higher
wifiClientSec->setInsecure();
#endif
} else if(_certInfo && strlen_P(_certInfo) > 0) {
wifiClientSec->setCACert(_certInfo);
}
#endif
_wifiClient = wifiClientSec;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/InfluxDbClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class InfluxDBClient {
~InfluxDBClient();
// Allows insecure connection by skiping server certificate validation.
// setInsecure must be called before calling any method initiating a connection to server.
void setInsecure(bool value);
void setInsecure(bool value = true);
// precision - timestamp precision of written data
// batchSize - number of points that will be written to the databases at once. Default 1 - writes immediately
// bufferSize - maximum size of Points buffer. Buffer contains new data that will be written to the database
Expand Down