From 45499b2ca3e8f3466e725dbc381757c89a7c39bf Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 27 Aug 2020 09:02:21 +0200 Subject: [PATCH] dirmngr: Print the last alert message returned by NTBTLS. * dirmngr/http.c (send_request): Print the last TLS alert. Signed-off-by: Werner Koch --- dirmngr/http.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dirmngr/http.c b/dirmngr/http.c index 6f994896c..0af0cc3fe 100644 --- a/dirmngr/http.c +++ b/dirmngr/http.c @@ -2057,6 +2057,14 @@ send_request (http_t hd, const char *httphost, const char *auth, while ((err = ntbtls_handshake (hd->session->tls_session))) { +#if NTBTLS_VERSION_NUMBER >= 0x000200 + unsigned int tlevel, ttype; + const char *s = ntbtls_get_last_alert (hd->session->tls_session, + &tlevel, &ttype); + if (s) + log_info ("TLS alert: %s (%u.%u)\n", s, tlevel, ttype); +#endif + switch (err) { default: