Skip to content

Commit 92373a9

Browse files
d-a-vearlephilhower
authored andcommitted
Deprecate axTLS, update examples (#5366)
* update examples * fix serial<->tcp example, use STASSID instead of SSID (name collision) * fix HTTPSRequest.ino * update AxTLS HTTPS examples, update AxTLS API to deprecated * fixes * fixes + fix astyle (no preproc directives) + restyling script * fix HTTPClient library * fixes * common.sh: do not reload arduino when already present (for locally CI testing) * common.sh: do not reload ArduinoJson when already present (for locally CI testing) * fix * fix * fix deprecated example * fix WiFiHTTPSServer.ino * reduce footprint * wipfix * fix led builtin * fix example * finished updating APSSID on all examples * style * restyle examples * helper to run CI test locally * local CI runner more verbose * +const * deprecation deprecation * deprecation * Update NTPClient.ino const char[] => const char * * Update interactive.ino const char[] => const char *
1 parent 8f28c88 commit 92373a9

File tree

70 files changed

+883
-291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+883
-291
lines changed

libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
#include <WiFiUdp.h>
44
#include <ArduinoOTA.h>
55

6-
const char* ssid = "..........";
7-
const char* password = "..........";
6+
#ifndef STASSID
7+
#define STASSID "your-ssid"
8+
#define STAPSK "your-password"
9+
#endif
10+
11+
const char* ssid = STASSID;
12+
const char* password = STAPSK;
813

914
void setup() {
1015
Serial.begin(115200);

libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
#include <WiFiUdp.h>
44
#include <ArduinoOTA.h>
55

6-
const char* ssid = "...";
7-
const char* password = "...";
6+
#ifndef STASSID
7+
#define STASSID "your-ssid"
8+
#define STAPSK "your-password"
9+
#endif
10+
11+
const char* ssid = STASSID;
12+
const char* password = STAPSK;
813
const char* host = "OTA-LEDS";
914

1015
int led_pin = 13;

libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@
1818
*/
1919

2020
/* Set these to your desired softAP credentials. They are not configurable at runtime */
21-
const char *softAP_ssid = "ESP_ap";
22-
const char *softAP_password = "12345678";
21+
#ifndef APSSID
22+
#define APSSID "ESP_ap"
23+
#define APPSK "12345678"
24+
#endif
25+
26+
const char *softAP_ssid = APSSID;
27+
const char *softAP_password = APPSK;
2328

2429
/* hostname for mDNS. Should work at least on windows. Try http://esp8266.local */
2530
const char *myHostname = "esp8266";

libraries/ESP8266AVRISP/examples/Arduino_Wifi_AVRISP/Arduino_Wifi_AVRISP.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
#include <ESP8266mDNS.h>
44
#include <ESP8266AVRISP.h>
55

6+
#ifndef STASSID
7+
#define STASSID "your-ssid"
8+
#define STAPSK "your-password"
9+
#endif
10+
611
const char* host = "esp8266-avrisp";
7-
const char* ssid = "**********";
8-
const char* pass = "**********";
12+
const char* ssid = STASSID;
13+
const char* pass = STAPSK;
914
const uint16_t port = 328;
1015
const uint8_t reset_pin = 5;
1116

libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@
1111

1212
#include <ESP8266HTTPClient.h>
1313

14-
const char* ssid = "SSID";
15-
const char* ssidPassword = "PASSWORD";
14+
#ifndef STASSID
15+
#define STASSID "your-ssid"
16+
#define STAPSK "your-password"
17+
#endif
18+
19+
const char* ssid = STASSID;
20+
const char* ssidPassword = STAPSK;
1621

1722
const char *username = "admin";
1823
const char *password = "admin";

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#if HTTPCLIENT_1_1_COMPATIBLE
2929
#include <ESP8266WiFi.h>
30-
#include <WiFiClientSecure.h>
30+
#include <WiFiClientSecureAxTLS.h>
3131
#endif
3232

3333
#include <StreamString.h>
@@ -64,7 +64,10 @@ class TLSTraits : public TransportTraits
6464

6565
std::unique_ptr<WiFiClient> create() override
6666
{
67+
#pragma GCC diagnostic push
68+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
6769
return std::unique_ptr<WiFiClient>(new axTLS::WiFiClientSecure());
70+
#pragma GCC diagnostic pop
6871
}
6972

7073
bool verify(WiFiClient& client, const char* host) override

libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@
1919
#include <ESP8266mDNS.h>
2020
#include <ESP8266HTTPUpdateServer.h>
2121

22+
#ifndef STASSID
23+
#define STASSID "your-ssid"
24+
#define STAPSK "your-password"
25+
#endif
26+
2227
const char* host = "esp8266-webupdate";
2328
const char* update_path = "/firmware";
2429
const char* update_username = "admin";
2530
const char* update_password = "admin";
26-
const char* ssid = "........";
27-
const char* password = "........";
31+
const char* ssid = STASSID;
32+
const char* password = STAPSK;
2833

2934
BearSSL::ESP8266WebServerSecure httpServer(443);
3035
ESP8266HTTPUpdateServer httpUpdater;

libraries/ESP8266HTTPUpdateServer/examples/SecureHTTPSUpdater/SecureHTTPSUpdater.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,17 @@
4848
#include <ESP8266mDNS.h>
4949
#include <ESP8266HTTPUpdateServer.h>
5050

51+
#ifndef STASSID
52+
#define STASSID "your-ssid"
53+
#define STAPSK "your-password"
54+
#endif
55+
5156
const char* host = "esp8266-webupdate";
5257
const char* update_path = "/firmware";
5358
const char* update_username = "admin";
5459
const char* update_password = "admin";
55-
const char* ssid = "........";
56-
const char* password = "........";
60+
const char* ssid = STASSID;
61+
const char* password = STAPSK;
5762

5863
ESP8266WebServerSecure httpServer(443);
5964
ESP8266HTTPUpdateServer httpUpdater;

libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@
88
#include <ESP8266mDNS.h>
99
#include <ESP8266HTTPUpdateServer.h>
1010

11+
#ifndef STASSID
12+
#define STASSID "your-ssid"
13+
#define STAPSK "your-password"
14+
#endif
15+
1116
const char* host = "esp8266-webupdate";
1217
const char* update_path = "/firmware";
1318
const char* update_username = "admin";
1419
const char* update_password = "admin";
15-
const char* ssid = "........";
16-
const char* password = "........";
20+
const char* ssid = STASSID;
21+
const char* password = STAPSK;
1722

1823
ESP8266WebServer httpServer(80);
1924
ESP8266HTTPUpdateServer httpUpdater;

libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@
88
#include <ESP8266mDNS.h>
99
#include <ESP8266HTTPUpdateServer.h>
1010

11+
#ifndef STASSID
12+
#define STASSID "your-ssid"
13+
#define STAPSK "your-password"
14+
#endif
15+
1116
const char* host = "esp8266-webupdate";
12-
const char* ssid = "........";
13-
const char* password = "........";
17+
const char* ssid = STASSID;
18+
const char* password = STAPSK;
1419

1520
ESP8266WebServer httpServer(80);
1621
ESP8266HTTPUpdateServer httpUpdater;

libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@
6060
#include <ESP8266WebServer.h>
6161
#include <WiFiClient.h>
6262

63-
const char* ssid = "replace_me";
64-
const char* password = "replace_me";
63+
#ifndef STASSID
64+
#define STASSID "your-ssid"
65+
#define STAPSK "your-password"
66+
#endif
67+
68+
const char* ssid = STASSID;
69+
const char* password = STAPSK;
6570

6671
ESP8266WebServer web_server(80);
6772

libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
#include <ESP8266WebServer.h>
33
#include <ESP8266NetBIOS.h>
44

5-
const char* ssid = "............";
6-
const char* password = "..............";
5+
#ifndef STASSID
6+
#define STASSID "your-ssid"
7+
#define STAPSK "your-password"
8+
#endif
9+
10+
const char* ssid = STASSID;
11+
const char* password = STAPSK;
712

813
ESP8266WebServer wwwserver(80);
914
String content;

libraries/ESP8266SSDP/examples/SSDP/SSDP.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
#include <ESP8266WebServer.h>
33
#include <ESP8266SSDP.h>
44

5-
const char* ssid = "************";
6-
const char* password = "***********";
5+
#ifndef STASSID
6+
#define STASSID "your-ssid"
7+
#define STAPSK "your-password"
8+
#endif
9+
10+
const char* ssid = STASSID;
11+
const char* password = STAPSK;
712

813
ESP8266WebServer HTTP(80);
914

libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@
3333
#include <ESP8266WebServer.h>
3434
#include <ESP8266mDNS.h>
3535

36-
const char *ssid = "YourSSIDHere";
37-
const char *password = "YourPSKHere";
36+
#ifndef STASSID
37+
#define STASSID "your-ssid"
38+
#define STAPSK "your-password"
39+
#endif
40+
41+
const char *ssid = STASSID;
42+
const char *password = STAPSK;
3843

3944
ESP8266WebServer server(80);
4045

libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@
3030

3131
#define DBG_OUTPUT_PORT Serial
3232

33-
const char* ssid = "wifi-ssid";
34-
const char* password = "wifi-password";
33+
#ifndef STASSID
34+
#define STASSID "your-ssid"
35+
#define STAPSK "your-password"
36+
#endif
37+
38+
const char* ssid = STASSID;
39+
const char* password = STAPSK;
3540
const char* host = "esp8266fs";
3641

3742
ESP8266WebServer server(80);

libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
#include <ESP8266WebServer.h>
44
#include <ESP8266mDNS.h>
55

6-
const char* ssid = "........";
7-
const char* password = "........";
6+
#ifndef STASSID
7+
#define STASSID "your-ssid"
8+
#define STAPSK "your-password"
9+
#endif
10+
11+
const char* ssid = STASSID;
12+
const char* password = STAPSK;
813

914
ESP8266WebServer server(80);
1015

libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@
1414
#include <ESP8266WebServerSecure.h>
1515
#include <ESP8266mDNS.h>
1616

17-
const char* ssid = "....";
18-
const char* password = "....";
17+
#ifndef STASSID
18+
#define STASSID "your-ssid"
19+
#define STAPSK "your-password"
20+
#endif
21+
22+
const char* ssid = STASSID;
23+
const char* password = STAPSK;
1924

2025
BearSSL::ESP8266WebServerSecure server(443);
2126

libraries/ESP8266WebServer/examples/HelloServerSecure/HelloServerSecure.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,13 @@
4646
#include <ESP8266WebServerSecure.h>
4747
#include <ESP8266mDNS.h>
4848

49-
const char* ssid = "........";
50-
const char* password = "........";
49+
#ifndef STASSID
50+
#define STASSID "your-ssid"
51+
#define STAPSK "your-password"
52+
#endif
53+
54+
const char* ssid = STASSID;
55+
const char* password = STAPSK;
5156

5257
ESP8266WebServerSecure server(443);
5358

libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
#include <ArduinoOTA.h>
1010
#include <ESP8266WebServer.h>
1111

12-
const char* ssid = "........";
13-
const char* password = "........";
12+
#ifndef STASSID
13+
#define STASSID "your-ssid"
14+
#define STAPSK "your-password"
15+
#endif
16+
17+
const char* ssid = STASSID;
18+
const char* password = STAPSK;
1419

1520
ESP8266WebServer server(80);
1621

libraries/ESP8266WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
#include <ArduinoOTA.h>
44
#include <ESP8266WebServer.h>
55

6-
const char* ssid = "........";
7-
const char* password = "........";
6+
#ifndef STASSID
7+
#define STASSID "your-ssid"
8+
#define STAPSK "your-password"
9+
#endif
10+
11+
const char* ssid = STASSID;
12+
const char* password = STAPSK;
813

914
ESP8266WebServer server(80);
1015

libraries/ESP8266WebServer/examples/SDWebServer/SDWebServer.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,13 @@
3636

3737
#define DBG_OUTPUT_PORT Serial
3838

39-
const char* ssid = "**********";
40-
const char* password = "**********";
39+
#ifndef STASSID
40+
#define STASSID "your-ssid"
41+
#define STAPSK "your-password"
42+
#endif
43+
44+
const char* ssid = STASSID;
45+
const char* password = STAPSK;
4146
const char* host = "esp8266sd";
4247

4348
ESP8266WebServer server(80);

libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
#include <WiFiClient.h>
33
#include <ESP8266WebServer.h>
44

5-
const char* ssid = "........";
6-
const char* password = "........";
5+
#ifndef STASSID
6+
#define STASSID "your-ssid"
7+
#define STAPSK "your-password"
8+
#endif
9+
10+
const char* ssid = STASSID;
11+
const char* password = STAPSK;
712

813
ESP8266WebServer server(80);
914

libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@
77
#include <ESP8266WebServer.h>
88
#include <ESP8266mDNS.h>
99

10+
#ifndef STASSID
11+
#define STASSID "your-ssid"
12+
#define STAPSK "your-password"
13+
#endif
14+
1015
const char* host = "esp8266-webupdate";
11-
const char* ssid = "........";
12-
const char* password = "........";
16+
const char* ssid = STASSID;
17+
const char* password = STAPSK;
1318

1419
ESP8266WebServer server(80);
1520
const char* serverIndex = "<form method='POST' action='/update' enctype='multipart/form-data'><input type='file' name='update'><input type='submit' value='Update'></form>";

libraries/ESP8266WebServer/src/ESP8266WebServerSecure.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@
1919
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2020
*/
2121

22-
#include "ESP8266WebServerSecureAxTLS.h"
22+
#include <WiFiClientSecure.h>
23+
24+
//#include "ESP8266WebServerSecureAxTLS.h"
2325
#include "ESP8266WebServerSecureBearSSL.h"

0 commit comments

Comments
 (0)