From 196f999e2aa6f77ad515c01a6e869e8f31255943 Mon Sep 17 00:00:00 2001 From: Muhammad Abdullah Date: Sat, 29 Aug 2020 22:19:25 +0500 Subject: [PATCH 1/2] ESP8266 issue caused by solving compile issue for ESP32 is solved. --- src/apollomacros.h | 2 +- src/arduinoWebSockets/WebSockets.h | 1 + src/arduinoWebSockets/WebSocketsClient.cpp | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/apollomacros.h b/src/apollomacros.h index b9b245a..5714b94 100644 --- a/src/apollomacros.h +++ b/src/apollomacros.h @@ -28,7 +28,7 @@ // Strings sizes #define FINGERPRINT_SIZE 256 -#define PACKET_SIZE 1024 +#define PACKET_SIZE 512 #define PING_PACKET_SIZE 64 #define TASK_SIZE 32 diff --git a/src/arduinoWebSockets/WebSockets.h b/src/arduinoWebSockets/WebSockets.h index 0d9b707..fadb3b3 100644 --- a/src/arduinoWebSockets/WebSockets.h +++ b/src/arduinoWebSockets/WebSockets.h @@ -40,6 +40,7 @@ #include #endif +#define DEBUG_ESP_PORT Serial #ifndef NODEBUG_WEBSOCKETS #ifdef DEBUG_ESP_PORT #define DEBUG_WEBSOCKETS(...) DEBUG_ESP_PORT.printf(__VA_ARGS__) diff --git a/src/arduinoWebSockets/WebSocketsClient.cpp b/src/arduinoWebSockets/WebSocketsClient.cpp index 2e7f4b2..ae30322 100644 --- a/src/arduinoWebSockets/WebSocketsClient.cpp +++ b/src/arduinoWebSockets/WebSocketsClient.cpp @@ -164,6 +164,13 @@ void WebSocketsClient::loop(void) { _client.tcp = NULL; } _client.ssl = new WEBSOCKETS_NETWORK_SSL_CLASS(); + /** Added ourselves */ + // Bug Fix + // Patch the Library to allow connection without + // Certificate Origin Confirmation +#if defined(ESP8266) + _client.ssl->setInsecure(); +#endif _client.tcp = _client.ssl; if(_CA_cert) { DEBUG_WEBSOCKETS("[WS-Client] setting CA certificate"); From d8831e8883443f215b1054c5cd20f2e9e07da740 Mon Sep 17 00:00:00 2001 From: Muhammad Abdullah Date: Sat, 29 Aug 2020 22:20:43 +0500 Subject: [PATCH 2/2] ESP8266 issue caused by solving compile issue for ESP32 is solved. --- src/arduinoWebSockets/WebSockets.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arduinoWebSockets/WebSockets.h b/src/arduinoWebSockets/WebSockets.h index fadb3b3..499015f 100644 --- a/src/arduinoWebSockets/WebSockets.h +++ b/src/arduinoWebSockets/WebSockets.h @@ -40,7 +40,7 @@ #include #endif -#define DEBUG_ESP_PORT Serial +// #define DEBUG_ESP_PORT Serial #ifndef NODEBUG_WEBSOCKETS #ifdef DEBUG_ESP_PORT #define DEBUG_WEBSOCKETS(...) DEBUG_ESP_PORT.printf(__VA_ARGS__)