From: Ken Hornstein Date: Wed, 31 May 2017 15:53:47 +0000 (-0400) Subject: Use original error code from OpenSSL. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/06fff87f275c3577a962537d44c558649285d8e4 Use original error code from OpenSSL. Reuse the error code we already retrieved from OpenSSL, otherwise the error might be cleared the next time we call ERR_get_error(). --- diff --git a/sbr/netsec.c b/sbr/netsec.c index a64743aa..358b97df 100644 --- a/sbr/netsec.c +++ b/sbr/netsec.c @@ -1631,7 +1631,7 @@ netsec_negotiate_tls(netsec_context *nsc, char **errstr) } } else { netsec_err(errstr, "TLS negotiation failed: %s", - ERR_error_string(ERR_get_error(), NULL)); + ERR_error_string(errcode, NULL)); } /*