tool_operate: limit is_using_schannel() call to Windows

Follow-up to cd238bb7ad #22552

Closes #22568
This commit is contained in:
Viktor Szakats 2026-08-13 10:39:28 +02:00
parent dea00a6d73
commit 9d034539ec
No known key found for this signature in database

View file

@ -2196,13 +2196,6 @@ static CURLcode is_using_schannel(int *pusing)
*pusing = using_schannel; *pusing = using_schannel;
return result; return result;
} }
#else
/* on non-Windows it can never use Schannel */
static CURLcode is_using_schannel(int *pusing)
{
*pusing = 0; /* never */
return CURLE_OK;
}
#endif #endif
/* Set the CA cert locations specified in the environment. For Windows if no /* Set the CA cert locations specified in the environment. For Windows if no
@ -2220,15 +2213,19 @@ static CURLcode cacertpaths(struct OperationConfig *config)
{ {
char *env; char *env;
CURLcode result; CURLcode result;
#ifdef _WIN32
int using_schannel; int using_schannel;
#endif
if(!feature_ssl || config->cacert || config->capath || if(!feature_ssl || config->cacert || config->capath ||
(config->insecure_ok && (!config->doh_url || config->doh_insecure_ok))) (config->insecure_ok && (!config->doh_url || config->doh_insecure_ok)))
return CURLE_OK; return CURLE_OK;
#ifdef _WIN32
result = is_using_schannel(&using_schannel); result = is_using_schannel(&using_schannel);
if(result || using_schannel) if(result || using_schannel)
return result; return result;
#endif
env = curl_getenv("CURL_CA_BUNDLE"); env = curl_getenv("CURL_CA_BUNDLE");
if(env) { if(env) {