Skip to content

Instantly share code, notes, and snippets.

@erikcorry
Created August 26, 2022 14:36
Show Gist options
  • Save erikcorry/411b30bfb0ae61373d3ac3204371616b to your computer and use it in GitHub Desktop.
Save erikcorry/411b30bfb0ae61373d3ac3204371616b to your computer and use it in GitHub Desktop.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 058e61b..c16551d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -127,7 +127,7 @@ if ("${TOIT_SYSTEM_NAME}" MATCHES "esp32")
set(MBEDTLS_C_FLAGS "-DMBEDTLS_CONFIG_FILE=\\\"mbedtls/esp_config.h\\\"")
else()
# These constants should stay in sync with the ones in the sdkconfig file of the ESP32 toolchain.
- set(MBEDTLS_C_FLAGS "-DMBEDTLS_SSL_IN_CONTENT_LEN=8100 -DMBEDTLS_SSL_OUT_CONTENT_LEN=3700 -DMBEDTLS_PLATFORM_MEMORY=1")
+ set(MBEDTLS_C_FLAGS "-DMBEDTLS_SSL_IN_CONTENT_LEN=8100 -DMBEDTLS_SSL_RECORD_SIZE_LIMIT=1 -DMBEDTLS_SSL_DEBUG_ALL=1 -DDEBUG_TLS=1 -DMBEDTLS_SSL_OUT_CONTENT_LEN=3700 -DMBEDTLS_PLATFORM_MEMORY=1")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TOIT_GENERIC_FLAGS} ${TOIT_LWIP_C_FLAGS} ${MBEDTLS_C_FLAGS}")
diff --git a/src/resources/tls.cc b/src/resources/tls.cc
index 514a9a1..717f719 100644
--- a/src/resources/tls.cc
+++ b/src/resources/tls.cc
@@ -154,7 +154,7 @@ void MbedTLSResourceGroup::init_conf(mbedtls_ssl_config* conf) {
#ifdef DEBUG_TLS
mbedtls_ssl_conf_dbg(conf, debug_printer, 0);
- mbedtls_debug_set_threshold(2);
+ mbedtls_debug_set_threshold(3);
#endif
mbedtls_ssl_conf_max_frag_len(conf, MBEDTLS_SSL_MAX_FRAG_LEN_4096);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment