mirror of
https://github.com/curl/curl.git
synced 2026-08-24 08:53:32 +03:00
setopt: claer the "custom" CA booleans when set to NULL
Mark them as custom choices only when pointer is passed, and clear them again when set to NULL. Closes #21901
This commit is contained in:
parent
9b69cfb937
commit
5df33efab4
1 changed files with 18 additions and 12 deletions
30
lib/setopt.c
30
lib/setopt.c
|
|
@ -1782,8 +1782,9 @@ static CURLcode setopt_cptr_proxy(struct Curl_easy *data, CURLoption option,
|
|||
* Set CA info SSL connection for proxy. Specify filename of the
|
||||
* CA certificate
|
||||
*/
|
||||
s->proxy_ssl.custom_cafile = TRUE;
|
||||
return Curl_setstropt(&s->str[STRING_SSL_CAFILE_PROXY], ptr);
|
||||
result = Curl_setstropt(&s->str[STRING_SSL_CAFILE_PROXY], ptr);
|
||||
s->proxy_ssl.custom_cafile = !!s->str[STRING_SSL_CAFILE_PROXY];
|
||||
return result;
|
||||
case CURLOPT_PROXY_CRLFILE:
|
||||
/*
|
||||
* Set CRL file info for SSL connection for proxy. Specify filename of the
|
||||
|
|
@ -1807,8 +1808,9 @@ static CURLcode setopt_cptr_proxy(struct Curl_easy *data, CURLoption option,
|
|||
#ifdef USE_SSL
|
||||
if(Curl_ssl_supports(data, SSLSUPP_CA_PATH)) {
|
||||
/* This does not work on Windows. */
|
||||
s->proxy_ssl.custom_capath = TRUE;
|
||||
return Curl_setstropt(&s->str[STRING_SSL_CAPATH_PROXY], ptr);
|
||||
result = Curl_setstropt(&s->str[STRING_SSL_CAPATH_PROXY], ptr);
|
||||
s->proxy_ssl.custom_capath = !!s->str[STRING_SSL_CAPATH_PROXY];
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
|
|
@ -1915,8 +1917,9 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option,
|
|||
/*
|
||||
* Set CA info for SSL connection. Specify filename of the CA certificate
|
||||
*/
|
||||
s->ssl.custom_cafile = TRUE;
|
||||
return Curl_setstropt(&s->str[STRING_SSL_CAFILE], ptr);
|
||||
result = Curl_setstropt(&s->str[STRING_SSL_CAFILE], ptr);
|
||||
s->ssl.custom_cafile = !!s->str[STRING_SSL_CAFILE];
|
||||
return result;
|
||||
case CURLOPT_CAPATH:
|
||||
/*
|
||||
* Set CA path info for SSL connection. Specify directory name of the CA
|
||||
|
|
@ -1925,8 +1928,9 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option,
|
|||
#ifdef USE_SSL
|
||||
if(Curl_ssl_supports(data, SSLSUPP_CA_PATH)) {
|
||||
/* This does not work on Windows. */
|
||||
s->ssl.custom_capath = TRUE;
|
||||
return Curl_setstropt(&s->str[STRING_SSL_CAPATH], ptr);
|
||||
result = Curl_setstropt(&s->str[STRING_SSL_CAPATH], ptr);
|
||||
s->ssl.custom_capath = !!s->str[STRING_SSL_CAPATH];
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
|
|
@ -2845,8 +2849,9 @@ static CURLcode setopt_blob(struct Curl_easy *data, CURLoption option,
|
|||
*/
|
||||
#ifdef USE_SSL
|
||||
if(Curl_ssl_supports(data, SSLSUPP_CAINFO_BLOB)) {
|
||||
s->proxy_ssl.custom_cablob = TRUE;
|
||||
return Curl_setblobopt(&s->blobs[BLOB_CAINFO_PROXY], blob);
|
||||
CURLcode result = Curl_setblobopt(&s->blobs[BLOB_CAINFO_PROXY], blob);
|
||||
s->proxy_ssl.custom_cablob = !!s->blobs[BLOB_CAINFO_PROXY];
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
|
|
@ -2870,8 +2875,9 @@ static CURLcode setopt_blob(struct Curl_easy *data, CURLoption option,
|
|||
*/
|
||||
#ifdef USE_SSL
|
||||
if(Curl_ssl_supports(data, SSLSUPP_CAINFO_BLOB)) {
|
||||
s->ssl.custom_cablob = TRUE;
|
||||
return Curl_setblobopt(&s->blobs[BLOB_CAINFO], blob);
|
||||
CURLcode result = Curl_setblobopt(&s->blobs[BLOB_CAINFO], blob);
|
||||
s->ssl.custom_cablob = !!s->blobs[BLOB_CAINFO];
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue