]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: improve error message for SYSCALL during connect
authorDaniel Stenberg <daniel@haxx.se>
Thu, 14 Nov 2019 13:19:04 +0000 (14:19 +0100)
committerJay Satiro <raysatiro@yahoo.com>
Sat, 23 Nov 2019 03:29:37 +0000 (22:29 -0500)
Reported-by: Paulo Roberto Tomasi
Bug: https://curl.haxx.se/mail/archive-2019-11/0005.html

Closes https://github.com/curl/curl/pull/4593

lib/vtls/openssl.c

index 26c8aa479b8b7cc0f40ebcf683c7493924fa2c0d..6b24c0cf4e89734cf57f4c5ad77d7b5bd7cbce4c 100644 (file)
@@ -2990,8 +2990,13 @@ static CURLcode ossl_connect_step2(struct connectdata *conn, int sockindex)
         const char * const hostname = SSL_IS_PROXY() ?
           conn->http_proxy.host.name : conn->host.name;
         const long int port = SSL_IS_PROXY() ? conn->port : conn->remote_port;
+        char extramsg[80]="";
+        int sockerr = SOCKERRNO;
+        if(sockerr && detail == SSL_ERROR_SYSCALL)
+          Curl_strerror(sockerr, extramsg, sizeof(extramsg));
         failf(data, OSSL_PACKAGE " SSL_connect: %s in connection to %s:%ld ",
-              SSL_ERROR_to_str(detail), hostname, port);
+              extramsg[0] ? extramsg : SSL_ERROR_to_str(detail),
+              hostname, port);
         return result;
       }