mirror of
https://github.com/pi-hole/FTL.git
synced 2025-12-24 05:58:32 +00:00
45 lines
1.7 KiB
Diff
45 lines
1.7 KiB
Diff
From f785e181f8b43fa9f77bf7dcc6711f16206c9e89 Mon Sep 17 00:00:00 2001
|
|
From: DL6ER <dl6er@dl6er.de>
|
|
Date: Thu, 25 May 2023 18:26:45 +0200
|
|
Subject: [PATCH] Add mbedTLS debug logging hook
|
|
|
|
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
|
---
|
|
src/webserver/civetweb/civetweb.h | 4 ++++
|
|
src/webserver/civetweb/mod_mbedtls.inl | 4 ++++
|
|
2 files changed, 8 insertions(+)
|
|
|
|
diff --git a/src/webserver/civetweb/civetweb.h b/src/webserver/civetweb/civetweb.h
|
|
index 2ad76693..52724199 100644
|
|
--- a/src/webserver/civetweb/civetweb.h
|
|
+++ b/src/webserver/civetweb/civetweb.h
|
|
@@ -938,6 +938,10 @@ int my_send_http_error_headers(struct mg_connection *conn,
|
|
void FTL_rewrite_pattern(char *filename, size_t filename_buf_len,
|
|
const char *root, const char *uri);
|
|
|
|
+#define MG_CONFIG_MBEDTLS_DEBUG 3
|
|
+void FTL_mbed_debug(void *user_param, int level, const char *file,
|
|
+ int line, const char *message);
|
|
+
|
|
// Buffer used for additional "Set-Cookie" headers
|
|
#define PIHOLE_HEADERS_MAXLEN 1024
|
|
extern char pi_hole_extra_headers[PIHOLE_HEADERS_MAXLEN];
|
|
diff --git a/src/webserver/civetweb/mod_mbedtls.inl b/src/webserver/civetweb/mod_mbedtls.inl
|
|
index e72685f4..00b9280a 100644
|
|
--- a/src/webserver/civetweb/mod_mbedtls.inl
|
|
+++ b/src/webserver/civetweb/mod_mbedtls.inl
|
|
@@ -83,6 +83,10 @@ mbed_sslctx_init(SSL_CTX *ctx, const char *crt)
|
|
mbedtls_ssl_conf_dbg(conf, mbed_debug, (void *)ctx);
|
|
#endif
|
|
|
|
+ /****************** Pi-hole change ******************/
|
|
+ mbedtls_ssl_conf_dbg(conf, FTL_mbed_debug, NULL);
|
|
+ /****************************************************/
|
|
+
|
|
#ifdef MBEDTLS_SSL_PROTO_TLS1_3
|
|
psa_status_t status = psa_crypto_init();
|
|
if (status != PSA_SUCCESS) {
|
|
--
|
|
2.34.1
|
|
|