From 080d4632298636a9a1b21c3419c059b95fb3cd37 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Mon, 5 Aug 2019 23:11:43 +0200 Subject: fetchmail no longer reports System error during SSL_connect(): Success. Fixes Debian Bug#928916, reported by Paul Kimoto. --- socket.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'socket.c') diff --git a/socket.c b/socket.c index b3eaaecc..cb93b60e 100644 --- a/socket.c +++ b/socket.c @@ -1225,14 +1225,17 @@ int SSLOpen(int sock, char *mycert, char *mykey, const char *myproto, int certck if (SSL_set_fd(_ssl_context[sock], sock) == 0 || (ssle_connect = SSL_connect(_ssl_context[sock])) < 1) { int e = errno; - unsigned long ssle_err_from_queue = ERR_peek_error(); unsigned long ssle_err_from_get_error = SSL_get_error(_ssl_context[sock], ssle_connect); + unsigned long ssle_err_from_queue = ERR_peek_error(); ERR_print_errors_fp(stderr); if (SSL_ERROR_SYSCALL == ssle_err_from_get_error && 0 == ssle_err_from_queue) { if (0 == ssle_connect) { - report(stderr, GT_("Server shut down connection prematurely during SSL_connect().\n")); + /* FIXME: the next line was hacked in 6.4.0-rc1 so the translation strings don't change. + * The %s could be merged to the inside of GT_(). */ + report(stderr, "%s: %s", servercname, GT_("Server shut down connection prematurely during SSL_connect().\n")); } else if (ssle_connect < 0) { - report(stderr, GT_("System error during SSL_connect(): %s\n"), strerror(e)); + report(stderr, "%s: ", servercname); + report(stderr, GT_("System error during SSL_connect(): %s\n"), e ? strerror(e) : GT_("handshake failed at protocol or connection level.")); } } SSL_free( _ssl_context[sock] ); -- cgit v1.2.3