From 4aee22436809af67f23170fe15106b91ff2971e6 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Mon, 22 Apr 2019 18:30:57 +0100 Subject: [PATCH 3/3] Fix TLS timeouts with recent versions of GnuTLS (#330) gnutls_handshake_set_timeout takes a timeout value in ms, but we were providing a value in seconds. This means that on new-enough platforms that use GnuTLS (e.g., Debian Buster), we would accidentally configure a timeout 1,000 times shorter than requested. --- src/data-types/mailstream_ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data-types/mailstream_ssl.c b/src/data-types/mailstream_ssl.c index a690152..970c892 100644 --- a/src/data-types/mailstream_ssl.c +++ b/src/data-types/mailstream_ssl.c @@ -636,7 +636,7 @@ static struct mailstream_ssl_data * ssl_data_new(int fd, time_t timeout, timeout_value = mailstream_network_delay.tv_sec * 1000 + mailstream_network_delay.tv_usec / 1000; } else { - timeout_value = timeout; + timeout_value = timeout * 1000; } #if GNUTLS_VERSION_NUMBER >= 0x030100 gnutls_handshake_set_timeout(session, timeout_value); -- 2.21.0