1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

SSL_get_verify_result() returns a long, so we receive the result in a long

and not an int.
This commit is contained in:
Daniel Stenberg 2004-07-04 21:42:32 +00:00
parent b9f76f11bb
commit 4511f7ac50

View File

@ -1078,6 +1078,7 @@ Curl_SSLConnect(struct connectdata *conn,
#ifdef USE_SSLEAY #ifdef USE_SSLEAY
struct SessionHandle *data = conn->data; struct SessionHandle *data = conn->data;
int err; int err;
long lerr;
int what; int what;
char * str; char * str;
SSL_METHOD *req_method; SSL_METHOD *req_method;
@ -1440,18 +1441,20 @@ Curl_SSLConnect(struct connectdata *conn,
/* We could do all sorts of certificate verification stuff here before /* We could do all sorts of certificate verification stuff here before
deallocating the certificate. */ deallocating the certificate. */
err = data->set.ssl.certverifyresult=SSL_get_verify_result(connssl->handle); lerr = data->set.ssl.certverifyresult=
SSL_get_verify_result(connssl->handle);
if(data->set.ssl.certverifyresult != X509_V_OK) { if(data->set.ssl.certverifyresult != X509_V_OK) {
if(data->set.ssl.verifypeer) { if(data->set.ssl.verifypeer) {
/* We probably never reach this, because SSL_connect() will fail /* We probably never reach this, because SSL_connect() will fail
and we return earlyer if verifypeer is set? */ and we return earlyer if verifypeer is set? */
failf(data, "SSL certificate verify result: %s (%d)", failf(data, "SSL certificate verify result: %s (%ld)",
X509_verify_cert_error_string(err), err); X509_verify_cert_error_string(lerr), lerr);
retcode = CURLE_SSL_PEER_CERTIFICATE; retcode = CURLE_SSL_PEER_CERTIFICATE;
} }
else else
infof(data, "SSL certificate verify result: %s (%d), continuing anyway.\n", infof(data, "SSL certificate verify result: %s (%ld),"
X509_verify_cert_error_string(err), err); " continuing anyway.\n",
X509_verify_cert_error_string(err), lerr);
} }
else else
infof(data, "SSL certificate verify ok.\n"); infof(data, "SSL certificate verify ok.\n");