mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-12 01:53:07 +03:00
ESP8266httpClient crash-on-destructor bugfix (#5220)
* Removed _client->stop() from destructor; some minor changes * Changed BasicHttpsClient.ino to allocate BearSSL::WiFiClientSecure object on the heap in stead of stack
This commit is contained in:
committed by
Earle F. Philhower, III
parent
1b1b0a28a8
commit
c8497da676
@ -41,13 +41,14 @@ void loop() {
|
||||
// wait for WiFi connection
|
||||
if ((WiFiMulti.run() == WL_CONNECTED)) {
|
||||
|
||||
BearSSL::WiFiClientSecure client;
|
||||
client.setFingerprint(fingerprint);
|
||||
BearSSL::WiFiClientSecure *client = new BearSSL::WiFiClientSecure;
|
||||
|
||||
client->setFingerprint(fingerprint);
|
||||
|
||||
HTTPClient https;
|
||||
|
||||
Serial.print("[HTTPS] begin...\n");
|
||||
if (https.begin(client, "https://jigsaw.w3.org/HTTP/connection.html")) { // HTTPS
|
||||
if (https.begin(*client, "https://jigsaw.w3.org/HTTP/connection.html")) { // HTTPS
|
||||
|
||||
|
||||
Serial.print("[HTTPS] GET...\n");
|
||||
@ -72,6 +73,8 @@ void loop() {
|
||||
} else {
|
||||
Serial.printf("[HTTPS] Unable to connect\n");
|
||||
}
|
||||
|
||||
delete client;
|
||||
}
|
||||
|
||||
delay(10000);
|
||||
|
Reference in New Issue
Block a user