Support Arduino >=3.x for custom network client (#954)

Support Arduino >=3.x for custom network client
This commit is contained in:
Moritz Ulmer
2025-10-02 17:18:44 +02:00
committed by GitHub
parent 6eee4c6dc6
commit 3af6593a00
5 changed files with 18 additions and 5 deletions

View File

@@ -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_);
}

View File

@@ -21,5 +21,5 @@
"type": "git",
"url": "https://github.com/Links2004/arduinoWebSockets.git"
},
"version": "2.7.0"
"version": "2.7.1"
}

View File

@@ -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)

View File

@@ -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);
};

View File

@@ -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_ */