aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGaurav Malhotra <malhotrag@gmail.com>2016-09-07 00:39:35 +0530
committerJay Satiro <raysatiro@yahoo.com>2016-09-06 16:17:37 -0400
commit8e176a7c799749af50df057c1bf63f1a6afb7dd5 (patch)
tree111b4e6a0a440fc6c3606cc5b14c1fc6c5704446 /lib
parent022dbdb8ac07379fa9cc2cbb3eba503b7f77a6ed (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/vtls/openssl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index d645b037f..0a3e6a3be 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));