summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-11-14 14:19:04 +0100
committerJay Satiro <raysatiro@yahoo.com>2019-11-22 22:29:37 -0500
commit1f4e7dc6613882d859cd805e83604eb1d29c9ff7 (patch)
treef9100bd5dacb1e6a0ef18eadffde7b9d13e209df
parent74f441c6d31ff8f8bfd242c3d4027d4a56230ce1 (diff)
downloadcurl-1f4e7dc6613882d859cd805e83604eb1d29c9ff7.tar.gz
openssl: improve error message for SYSCALL during connect
Reported-by: Paulo Roberto Tomasi Bug: https://curl.haxx.se/mail/archive-2019-11/0005.html Closes https://github.com/curl/curl/pull/4593
-rw-r--r--lib/vtls/openssl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 26c8aa479..6b24c0cf4 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -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;
}