From 858efc353dfabf470e52b051cbccb8d46badd2d8 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 3 Nov 2019 09:47:25 +0000 Subject: [PATCH] [Minor] Ssl: Improve logging --- src/libutil/ssl_util.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/libutil/ssl_util.c b/src/libutil/ssl_util.c index e7bd33be9..f4fe3b31c 100644 --- a/src/libutil/ssl_util.c +++ b/src/libutil/ssl_util.c @@ -456,7 +456,11 @@ rspamd_ssl_shutdown (struct rspamd_ssl_connection *conn) } else { /* Cannot do anything else, fatal error */ - msg_debug_ssl ("ssl shutdown: fatal error"); + GError *err = NULL; + + rspamd_tls_set_error (ret, "final shutdown", &err); + msg_debug_ssl ("ssl shutdown: fatal error: %e", err); + g_error_free (err); rspamd_ssl_connection_dtor (conn); return; @@ -652,8 +656,13 @@ rspamd_ssl_connect_fd (struct rspamd_ssl_connection *conn, gint fd, msg_debug_ssl ("not connected, want write"); } else { + GError *err = NULL; + conn->shut = ssl_shut_unclean; - msg_debug_ssl ("not connected, fatal error %d", ret); + rspamd_tls_set_error (ret, "initial connect", &err); + msg_debug_ssl ("not connected, fatal error %e", err); + g_error_free (err); + return FALSE; } -- 2.39.5