Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wolfssl: if CURLOPT_CAINFO_BLOB is set, ignore the CA files #11884

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
56 changes: 29 additions & 27 deletions lib/vtls/wolfssl.c
Expand Up @@ -541,37 +541,39 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
}

#ifndef NO_FILESYSTEM
/* load trusted cacert */
if(conn_config->CAfile) {
if(1 != wolfSSL_CTX_load_verify_locations(backend->ctx,
conn_config->CAfile,
conn_config->CApath)) {
if(conn_config->verifypeer && !imported_ca_info_blob &&
!imported_native_ca) {
/* Fail if we insist on successfully verifying the server. */
failf(data, "error setting certificate verify locations:"
" CAfile: %s CApath: %s",
conn_config->CAfile?
conn_config->CAfile: "none",
conn_config->CApath?
conn_config->CApath : "none");
return CURLE_SSL_CACERT_BADFILE;
else {
/* load trusted cacert from file if not blob */
if(conn_config->CAfile || conn_config->CApath) {
if(1 != wolfSSL_CTX_load_verify_locations(backend->ctx,
conn_config->CAfile,
conn_config->CApath)) {
if(conn_config->verifypeer && !imported_ca_info_blob &&
!imported_native_ca) {
/* Fail if we insist on successfully verifying the server. */
failf(data, "error setting certificate verify locations:"
" CAfile: %s CApath: %s",
conn_config->CAfile?
conn_config->CAfile: "none",
conn_config->CApath?
conn_config->CApath : "none");
return CURLE_SSL_CACERT_BADFILE;
}
else {
/* Just continue with a warning if no strict certificate
verification is required. */
infof(data, "error setting certificate verify locations,"
" continuing anyway:");
}
}
else {
/* Just continue with a warning if no strict certificate
verification is required. */
infof(data, "error setting certificate verify locations,"
" continuing anyway:");
/* Everything is fine. */
infof(data, "successfully set certificate verify locations:");
}
infof(data, " CAfile: %s",
conn_config->CAfile ? conn_config->CAfile : "none");
infof(data, " CApath: %s",
conn_config->CApath ? conn_config->CApath : "none");
}
else {
/* Everything is fine. */
infof(data, "successfully set certificate verify locations:");
}
infof(data, " CAfile: %s",
conn_config->CAfile ? conn_config->CAfile : "none");
infof(data, " CApath: %s",
conn_config->CApath ? conn_config->CApath : "none");
}

/* Load the client certificate, and private key */
Expand Down