ssl_verify_callback(): Log when mbedtls_pem_write_buffer() fails
authorFabian Keil <fk@fabiankeil.de>
Wed, 4 Mar 2020 15:01:23 +0000 (16:01 +0100)
committerFabian Keil <fk@fabiankeil.de>
Sat, 16 May 2020 09:10:49 +0000 (11:10 +0200)
Sponsored by: Robert Klemme

ssl.c

diff --git a/ssl.c b/ssl.c
index 4d94b2e..32b51ad 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -2127,6 +2127,12 @@ static int ssl_verify_callback(void *csp_void, mbedtls_x509_crt *crt,
       crt->raw.p, crt->raw.len, (unsigned char *)last->file_buf,
       sizeof(last->file_buf)-1, &olen)) != 0)
    {
+      char err_buf[ERROR_BUF_SIZE];
+
+      mbedtls_strerror(ret, err_buf, sizeof(err_buf));
+      log_error(LOG_LEVEL_ERROR, "mbedtls_pem_write_buffer() failed: %s",
+         err_buf);
+
       return(ret);
    }