From: Jeremy Harris Date: Fri, 4 Oct 2019 09:21:24 +0000 (+0100) Subject: OpenSSL: emit actual version on "wrong version number" error for SSL_accept X-Git-Tag: exim-4.93-RC1~24 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fa9e4a1d04268f4a7e46166f70b6d5def10297f9;p=exim.git OpenSSL: emit actual version on "wrong version number" error for SSL_accept --- diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c index 7a625a8ba..247da092f 100644 --- a/src/src/tls-openssl.c +++ b/src/src/tls-openssl.c @@ -2706,8 +2706,14 @@ if (rc <= 0) /* Handle genuine errors */ case SSL_ERROR_SSL: - (void) tls_error(US"SSL_accept", NULL, sigalrm_seen ? US"timed out" : NULL, errstr); + { + uschar * s = US"SSL_accept"; + ulong e = ERR_peek_error(); + if (ERR_GET_REASON(e) == SSL_R_WRONG_VERSION_NUMBER) + s = string_sprintf("%s (%s)", s, SSL_get_version(server_ssl)); + (void) tls_error(s, NULL, sigalrm_seen ? US"timed out" : NULL, errstr); return FAIL; + } default: DEBUG(D_tls) debug_printf("Got SSL error %d\n", error);