File tree 1 file changed +6
-3
lines changed
libraries/ESP8266HTTPClient/examples/BasicHttpsClient
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -41,13 +41,14 @@ void loop() {
41
41
// wait for WiFi connection
42
42
if ((WiFiMulti.run () == WL_CONNECTED)) {
43
43
44
- BearSSL::WiFiClientSecure client;
45
- client.setFingerprint (fingerprint);
44
+ BearSSL::WiFiClientSecure *client = new BearSSL::WiFiClientSecure;
45
+
46
+ client->setFingerprint (fingerprint);
46
47
47
48
HTTPClient https;
48
49
49
50
Serial.print (" [HTTPS] begin...\n " );
50
- if (https.begin (client, " https://jigsaw.w3.org/HTTP/connection.html" )) { // HTTPS
51
+ if (https.begin (* client, " https://jigsaw.w3.org/HTTP/connection.html" )) { // HTTPS
51
52
52
53
53
54
Serial.print (" [HTTPS] GET...\n " );
@@ -72,6 +73,8 @@ void loop() {
72
73
} else {
73
74
Serial.printf (" [HTTPS] Unable to connect\n " );
74
75
}
76
+
77
+ delete client;
75
78
}
76
79
77
80
delay (10000 );
You can’t perform that action at this time.
0 commit comments