cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] Set mbedtls debug threshold to 4 (verbose) when MBEDTLS_DEBUG is defined

From: Thomas Glanzmann <thomas_at_glanzmann.de>
Date: Wed, 3 Aug 2016 08:20:16 +0200

In order to make MBEDTLS_DEBUG work, the debug threshold must be unequal to 0.
This patch also adds a comment how mbedtls must be compiled in order to make
debugging work, and explains the possible debug levels.

---
 lib/vtls/mbedtls.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c
index 18c2d4f..8c0b229 100644
--- a/lib/vtls/mbedtls.c
+++ b/lib/vtls/mbedtls.c
@@ -420,7 +420,15 @@ mbed_connect_step1(struct connectdata *conn,
 #endif
 
 #ifdef MBEDTLS_DEBUG
+  /* In order to make that work in mbedtls MBEDTLS_DEBUG_C must be defined. */
   mbedtls_ssl_conf_dbg(&connssl->config, mbed_debug, data);
+  /* - 0 No debug
+   * - 1 Error
+   * - 2 State change
+   * - 3 Informational
+   * - 4 Verbose
+   */
+  mbedtls_debug_set_threshold(4);
 #endif
 
   connssl->connecting_state = ssl_connect_2;
-- 
2.1.4
--2oS5YaxWCcQjTEyO
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLQpMaXN0IGFkbWluOiBodHRwczovL2Nvb2wuaGF4eC5zZS9saXN0L2xpc3RpbmZv
L2N1cmwtbGlicmFyeQpFdGlxdWV0dGU6ICBodHRwczovL2N1cmwuaGF4eC5zZS9tYWlsL2V0aXF1
ZXR0ZS5odG1s
--2oS5YaxWCcQjTEyO--
Received on 2001-09-17