From: Gaurav Malhotra Date: Tue, 6 Sep 2016 19:09:35 +0000 (+0530) Subject: openssl: fix CURLINFO_SSL_VERIFYRESULT X-Git-Tag: curl-7_50_2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e176a7c799749af50df057c1bf63f1a6afb7dd5;p=thirdparty%2Fcurl.git openssl: fix CURLINFO_SSL_VERIFYRESULT CURLINFO_SSL_VERIFYRESULT does not get the certificate verification result when SSL_connect fails because of a certificate verification error. This fix saves the result of SSL_get_verify_result so that it is returned by CURLINFO_SSL_VERIFYRESULT. Closes https://github.com/curl/curl/pull/995 --- diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index d645b037fe..0a3e6a3bed 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2188,6 +2188,7 @@ static CURLcode ossl_connect_step2(struct connectdata *conn, int sockindex) lerr = SSL_get_verify_result(connssl->handle); if(lerr != X509_V_OK) { + data->set.ssl.certverifyresult = lerr; snprintf(error_buffer, sizeof(error_buffer), "SSL certificate problem: %s", X509_verify_cert_error_string(lerr));