Skip to content

deprecate axTLS, update examples #5366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Nov 30, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9dfdfd5
update examples
d-a-v Nov 22, 2018
a28b183
fix serial<->tcp example, use STASSID instead of SSID (name collision)
d-a-v Nov 23, 2018
be3c5cf
fix HTTPSRequest.ino
d-a-v Nov 23, 2018
7e40b18
update AxTLS HTTPS examples, update AxTLS API to deprecated
d-a-v Nov 24, 2018
3e94897
fixes
d-a-v Nov 24, 2018
c2301e2
fixes + fix astyle (no preproc directives) + restyling script
d-a-v Nov 24, 2018
0b849cf
fix HTTPClient library
d-a-v Nov 24, 2018
8ecae22
fixes
d-a-v Nov 24, 2018
68f77a5
common.sh: do not reload arduino when already present (for locally CI…
d-a-v Nov 24, 2018
f1bb21d
common.sh: do not reload ArduinoJson when already present (for locall…
d-a-v Nov 24, 2018
797bb37
fix
d-a-v Nov 24, 2018
9c2c90a
fix
d-a-v Nov 24, 2018
dd0f55f
fix deprecated example
d-a-v Nov 24, 2018
e7ec28a
fix WiFiHTTPSServer.ino
d-a-v Nov 24, 2018
70ef54b
reduce footprint
d-a-v Nov 25, 2018
003c190
wipfix
d-a-v Nov 25, 2018
49a5d9b
fix led builtin
d-a-v Nov 25, 2018
c48d5f4
fix example
d-a-v Nov 25, 2018
119e73d
finished updating APSSID on all examples
d-a-v Nov 25, 2018
8a28979
style
d-a-v Nov 25, 2018
bc945af
Merge branch 'master' into examples
d-a-v Nov 25, 2018
d742388
Merge branch 'master' into examples
earlephilhower Nov 26, 2018
ef890c9
Merge branch 'master' into examples
d-a-v Nov 27, 2018
b7c4e55
restyle examples
d-a-v Nov 27, 2018
8473361
Merge branch 'master' into examples
d-a-v Nov 28, 2018
e2ebfab
helper to run CI test locally
d-a-v Nov 28, 2018
ab0b372
local CI runner more verbose
d-a-v Nov 28, 2018
a9a7572
Merge branch 'master' into examples
d-a-v Nov 28, 2018
cbebae6
Merge branch 'master' into examples
d-a-v Nov 29, 2018
822c38c
+const
d-a-v Nov 29, 2018
42dc0b7
deprecation deprecation
d-a-v Nov 29, 2018
3c298e6
deprecation
d-a-v Nov 29, 2018
c00b975
Merge branch 'master' into examples
d-a-v Nov 29, 2018
6048663
Merge branch 'master' into examples
earlephilhower Nov 30, 2018
5385a93
Update NTPClient.ino
devyte Nov 30, 2018
cc15e6f
Update interactive.ino
devyte Nov 30, 2018
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
4 changes: 2 additions & 2 deletions libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#define STAPSK "your-password"
#endif

char ssid[] = STASSID; // your network SSID (name)
char pass[] = STAPSK; // your network password
const char ssid[] = STASSID; // your network SSID (name)
const char pass[] = STAPSK; // your network password


unsigned int localPort = 2390; // local port to listen for UDP packets
Expand Down
55 changes: 38 additions & 17 deletions libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,48 +121,69 @@ class WiFiClientSecure : public WiFiClient {
static bool probeMaxFragmentLength(const char *hostname, uint16_t port, uint16_t len);
static bool probeMaxFragmentLength(const String& host, uint16_t port, uint16_t len);

bool setCACert(const uint8_t* pk, size_t size);
bool setCertificate(const uint8_t* pk, size_t size);
bool setPrivateKey(const uint8_t* pk, size_t size);
////////////////////////////////////////////////////
// AxTLS API deprecated warnings to help upgrading

#define AXTLS_DEPRECATED
#define xAXTLS_DEPRECATED \
__attribute__((deprecated( \
"This is deprecated AxTLS API, " \
"check https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/WiFiClientSecure.h#L25-L99")))

bool setCACert(const uint8_t* pk, size_t size) AXTLS_DEPRECATED;
bool setCertificate(const uint8_t* pk, size_t size) AXTLS_DEPRECATED;
bool setPrivateKey(const uint8_t* pk, size_t size) AXTLS_DEPRECATED;

bool setCACert_P(PGM_VOID_P pk, size_t size) { return setCACert((const uint8_t *)pk, size); }
bool setCertificate_P(PGM_VOID_P pk, size_t size) { return setCertificate((const uint8_t *)pk, size); }
bool setPrivateKey_P(PGM_VOID_P pk, size_t size) { return setPrivateKey((const uint8_t *)pk, size); }
bool loadCACert(Stream& stream, size_t size) AXTLS_DEPRECATED;
bool loadCertificate(Stream& stream, size_t size) AXTLS_DEPRECATED;
bool loadPrivateKey(Stream& stream, size_t size) AXTLS_DEPRECATED;

bool loadCACert(Stream& stream, size_t size);
bool loadCertificate(Stream& stream, size_t size);
bool loadPrivateKey(Stream& stream, size_t size);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

bool setCACert_P(PGM_VOID_P pk, size_t size) AXTLS_DEPRECATED {
return setCACert((const uint8_t *)pk, size);
}

bool setCertificate_P(PGM_VOID_P pk, size_t size) AXTLS_DEPRECATED {
return setCertificate((const uint8_t *)pk, size);
}

bool setPrivateKey_P(PGM_VOID_P pk, size_t size) AXTLS_DEPRECATED {
return setPrivateKey((const uint8_t *)pk, size);
}

template<typename TFile>
bool loadCertificate(TFile& file) {
bool loadCertificate(TFile& file) AXTLS_DEPRECATED {
return loadCertificate(file, file.size());
}

template<typename TFile>
bool loadPrivateKey(TFile& file) {
bool loadPrivateKey(TFile& file) AXTLS_DEPRECATED {
return loadPrivateKey(file, file.size());
}

template<typename TFile>
bool loadCACert(TFile& file) {
bool loadCACert(TFile& file) AXTLS_DEPRECATED {
return loadCACert(file, file.size());
}

// AxTLS API deprecated warnings to help upgrading
#pragma GCC diagnostic pop

bool verify(const char* fingerprint, const char* domain_name)
__attribute__((deprecated("This is deprecated AxTLS API, check https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/WiFiClientSecure.h#L25-L99"))) {
bool verify(const char* fingerprint, const char* domain_name) AXTLS_DEPRECATED {
(void)fingerprint;
(void)domain_name;
return connected();
}

bool verifyCertChain(const char* domain_name)
__attribute__((deprecated("This is deprecated AxTLS API, check https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/WiFiClientSecure.h#L25-L99"))) {
bool verifyCertChain(const char* domain_name) AXTLS_DEPRECATED {
(void)domain_name;
return connected();
}

// AxTLS API deprecated section end
/////////////////////////////////////

private:
void _clear();
void _clearAuthenticationSettings();
Expand Down