From a2c3152ca7e26bfd74f87e4761ae4461856ac9e7 Mon Sep 17 00:00:00 2001 From: Emil Muratov Date: Thu, 19 Dec 2024 13:20:08 +0900 Subject: [PATCH] reset wrong SSL connections instead of close since we can't properly handle SSL beyond firts packet it does not make much sense to linger it with proper fin/ack timewait process. A TCP RST would recycle memory much faster. --- src/WebRequest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WebRequest.cpp b/src/WebRequest.cpp index 3dd885d..18ac9c8 100644 --- a/src/WebRequest.cpp +++ b/src/WebRequest.cpp @@ -71,10 +71,10 @@ void AsyncWebServerRequest::_onData(void* buf, size_t len) { #ifndef ASYNC_TCP_SSL_ENABLED if (_parseState == PARSE_REQ_START && len && ((uint8_t*)buf)[0] == 0x16) { // 0x16 indicates a Handshake message (SSL/TLS). #ifdef ESP32 - log_d("SSL/TLS handshake detected: closing connection"); + log_d("SSL/TLS handshake detected: resetting connection"); #endif _parseState = PARSE_REQ_FAIL; - _client->close(); + _client->abort(); return; } #endif