From 3d4a7012333b81c5aa3cb98254601e0d70d946f1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 3 Mar 2026 18:03:52 +0100 Subject: [PATCH] config2setopts: restore proper ignoring of CAINFO BLOB option errors A regression from refactors Spotted by Codex Security Closes #20799 --- src/config2setopts.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/config2setopts.c b/src/config2setopts.c index 17eb8c73e9..20d87a070a 100644 --- a/src/config2setopts.c +++ b/src/config2setopts.c @@ -308,9 +308,10 @@ static CURLcode ssl_ca_setopts(struct OperationConfig *config, CURL *curl) blob.flags = CURL_BLOB_NOCOPY; notef("Using embedded CA bundle (%zu bytes)", blob.len); result = curl_easy_setopt(curl, CURLOPT_CAINFO_BLOB, &blob); - if(result == CURLE_NOT_BUILT_IN) { + if((result == CURLE_NOT_BUILT_IN) || (result == CURLE_UNKNOWN_OPTION)) { warnf("ignoring %s, not supported by libcurl with %s", "embedded CA bundle", ssl_backend()); + result = CURLE_OK; } } if(!config->proxy_cacert && !config->proxy_capath) { @@ -320,9 +321,10 @@ static CURLcode ssl_ca_setopts(struct OperationConfig *config, CURL *curl) blob.flags = CURL_BLOB_NOCOPY; notef("Using embedded CA bundle, for proxies (%zu bytes)", blob.len); result = curl_easy_setopt(curl, CURLOPT_PROXY_CAINFO_BLOB, &blob); - if(result == CURLE_NOT_BUILT_IN) { + if((result == CURLE_NOT_BUILT_IN) || (result == CURLE_UNKNOWN_OPTION)) { warnf("ignoring %s, not supported by libcurl with %s", "embedded CA bundle", ssl_backend()); + result = CURLE_OK; } } #endif