From 3c3ccfa6604037de954444f120c0e6cc299ce478 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sat, 8 Jan 2022 18:10:17 +0100 Subject: [PATCH] TLS ESP32, if max packet size is more than 2000, extend TLS buffers to 4K --- tasmota/xdrv_02_9_mqtt.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasmota/xdrv_02_9_mqtt.ino b/tasmota/xdrv_02_9_mqtt.ino index d245a1964..a86d0328c 100644 --- a/tasmota/xdrv_02_9_mqtt.ino +++ b/tasmota/xdrv_02_9_mqtt.ino @@ -211,7 +211,11 @@ void MqttInit(void) { if (Mqtt.mqtt_tls) { #ifdef ESP32 + #if MQTT_MAX_PACKET_SIZE > 2000 + tlsClient = new BearSSL::WiFiClientSecure_light(4096,4096); + #else tlsClient = new BearSSL::WiFiClientSecure_light(2048,2048); + #endif #else // ESP32 - ESP8266 tlsClient = new BearSSL::WiFiClientSecure_light(1024,1024); #endif