From 3af6593a00bd4dc8b18be5082575618cf2acc44d Mon Sep 17 00:00:00 2001 From: Moritz Ulmer Date: Thu, 2 Oct 2025 17:18:44 +0200 Subject: [PATCH] Support Arduino >=3.x for custom network client (#954) Support Arduino >=3.x for custom network client --- .../CustomNetworkClient/src/network_client_secure.cpp | 9 +++++++++ library.json | 2 +- library.properties | 2 +- src/WebSocketsNetworkClientSecure.h | 4 ++++ src/WebSocketsVersion.h | 6 +++--- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/examples/esp32_pio/CustomNetworkClient/src/network_client_secure.cpp b/examples/esp32_pio/CustomNetworkClient/src/network_client_secure.cpp index a2e78a2..9ee35d5 100644 --- a/examples/esp32_pio/CustomNetworkClient/src/network_client_secure.cpp +++ b/examples/esp32_pio/CustomNetworkClient/src/network_client_secure.cpp @@ -158,11 +158,20 @@ void WebSocketsNetworkClientSecure::setCACert(const char *rootCA) { Serial.println(_impl->no_interface_error_); } +#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 4) +void WebSocketsNetworkClientSecure::setCACertBundle(const uint8_t *bundle, + size_t bundle_size) { +#else void WebSocketsNetworkClientSecure::setCACertBundle(const uint8_t *bundle) { +#endif if (_impl->gsm_client_secure_) { return _impl->gsm_client_secure_->setCACertBundle(bundle); } else if (_impl->wifi_client_secure_) { +#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 4) + return _impl->wifi_client_secure_->setCACertBundle(bundle, bundle_size); +#else return _impl->wifi_client_secure_->setCACertBundle(bundle); +#endif } Serial.println(_impl->no_interface_error_); } diff --git a/library.json b/library.json index 1df003f..28166ec 100644 --- a/library.json +++ b/library.json @@ -21,5 +21,5 @@ "type": "git", "url": "https://github.com/Links2004/arduinoWebSockets.git" }, - "version": "2.7.0" + "version": "2.7.1" } \ No newline at end of file diff --git a/library.properties b/library.properties index 370182d..c620aad 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=WebSockets -version=2.7.0 +version=2.7.1 author=Markus Sattler maintainer=Markus Sattler sentence=WebSockets for Arduino (Server + Client) diff --git a/src/WebSocketsNetworkClientSecure.h b/src/WebSocketsNetworkClientSecure.h index efa9cd1..d2d22b7 100644 --- a/src/WebSocketsNetworkClientSecure.h +++ b/src/WebSocketsNetworkClientSecure.h @@ -24,7 +24,11 @@ class WebSocketsNetworkClientSecure : public WebSocketsNetworkClient { operator bool() override; void setCACert(const char * rootCA); +#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 4) + void setCACertBundle(const uint8_t * bundle, size_t bundle_size); +#else void setCACertBundle(const uint8_t * bundle); +#endif void setInsecure(); bool verify(const char * fingerprint, const char * domain_name); }; diff --git a/src/WebSocketsVersion.h b/src/WebSocketsVersion.h index 99f7471..437464f 100644 --- a/src/WebSocketsVersion.h +++ b/src/WebSocketsVersion.h @@ -25,12 +25,12 @@ #ifndef WEBSOCKETSVERSION_H_ #define WEBSOCKETSVERSION_H_ -#define WEBSOCKETS_VERSION "2.7.0" +#define WEBSOCKETS_VERSION "2.7.1" #define WEBSOCKETS_VERSION_MAJOR 2 #define WEBSOCKETS_VERSION_MINOR 7 -#define WEBSOCKETS_VERSION_PATCH 0 +#define WEBSOCKETS_VERSION_PATCH 1 -#define WEBSOCKETS_VERSION_INT 2007000 +#define WEBSOCKETS_VERSION_INT 2007001 #endif /* WEBSOCKETSVERSION_H_ */