From 66a15c7a7280d81fbcad373a24d15aed9d423d9b Mon Sep 17 00:00:00 2001 From: Moritz Ulmer Date: Sat, 15 Jun 2024 22:22:32 +0200 Subject: [PATCH] Fix non-ESP32 builds --- src/WebSocketsClient.cpp | 6 +++--- src/WebSocketsClient.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/WebSocketsClient.cpp b/src/WebSocketsClient.cpp index c0c64ae..2488dea 100644 --- a/src/WebSocketsClient.cpp +++ b/src/WebSocketsClient.cpp @@ -48,7 +48,9 @@ void WebSocketsClient::begin(const char * host, uint16_t port, const char * url, #if defined(HAS_SSL) _fingerprint = SSL_FINGERPRINT_NULL; _CA_cert = NULL; +#ifdef ESP32 _CA_bundle = NULL; +#endif #endif _client.num = 0; @@ -242,12 +244,10 @@ void WebSocketsClient::loop(void) { #else #error setCACert not implemented #endif +#if defined(ESP32) } else if(_CA_bundle) { DEBUG_WEBSOCKETS("[WS-Client] setting CA bundle"); -#if defined(ESP32) _client.ssl->setCACertBundle(_CA_bundle); -#else -#error setCABundle not implemented #endif #if defined(ESP32) } else if(!SSL_FINGERPRINT_IS_SET) { diff --git a/src/WebSocketsClient.h b/src/WebSocketsClient.h index 15a4080..081e37e 100644 --- a/src/WebSocketsClient.h +++ b/src/WebSocketsClient.h @@ -53,7 +53,9 @@ class WebSocketsClient : protected WebSockets { void setSSLClientCertKey(const char * clientCert = NULL, const char * clientPrivateKey = NULL); #endif void beginSslWithCA(const char * host, uint16_t port, const char * url = "/", const char * CA_cert = NULL, const char * protocol = "arduino"); +#ifdef ESP32 void beginSslWithBundle(const char * host, uint16_t port, const char * url = "/", const uint8_t * CA_bundle = NULL, const char * protocol = "arduino"); +#endif #endif void beginSocketIO(const char * host, uint16_t port, const char * url = "/socket.io/?EIO=3", const char * protocol = "arduino");