Commit 8e176a7c authored by Gaurav Malhotra's avatar Gaurav Malhotra Committed by Jay Satiro
Browse files

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
parent 022dbdb8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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));