]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: fix CURLINFO_SSL_VERIFYRESULT
authorGaurav Malhotra <malhotrag@gmail.com>
Tue, 6 Sep 2016 19:09:35 +0000 (00:39 +0530)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 6 Sep 2016 20:17:37 +0000 (16:17 -0400)
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

lib/vtls/openssl.c

index d645b037fe877b0d4ce4773b27e0427b3734e55a..0a3e6a3beda271305c09d01da98de97969a057dd 100644 (file)
@@ -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));