mirror of
https://github.com/curl/curl.git
synced 2024-11-21 01:16:58 +08:00
url: Update current connection SSL verify params in setopt
Now VERIFYHOST, VERIFYPEER and VERIFYSTATUS options change during active
connection updates the current connection's (i.e.'connectdata'
structure) appropriate ssl_config (and ssl_proxy_config) structures
variables, making these options effective for ongoing connection.
This functionality was available before and was broken by the
following change:
"proxy: Support HTTPS proxy and SOCKS+HTTP(s)"
CommitId: cb4e2be7c6
.
Bug: https://github.com/curl/curl/issues/1941
Closes https://github.com/curl/curl/pull/1951
This commit is contained in:
parent
de7597f155
commit
5505df7d24
30
lib/url.c
30
lib/url.c
@ -2141,6 +2141,12 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
|
||||
*/
|
||||
data->set.ssl.primary.verifypeer = (0 != va_arg(param, long)) ?
|
||||
TRUE : FALSE;
|
||||
|
||||
/* Update the current connection ssl_config. */
|
||||
if(data->easy_conn) {
|
||||
data->easy_conn->ssl_config.verifypeer =
|
||||
data->set.ssl.primary.verifypeer;
|
||||
}
|
||||
break;
|
||||
case CURLOPT_PROXY_SSL_VERIFYPEER:
|
||||
/*
|
||||
@ -2148,6 +2154,12 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
|
||||
*/
|
||||
data->set.proxy_ssl.primary.verifypeer =
|
||||
(0 != va_arg(param, long))?TRUE:FALSE;
|
||||
|
||||
/* Update the current connection proxy_ssl_config. */
|
||||
if(data->easy_conn) {
|
||||
data->easy_conn->proxy_ssl_config.verifypeer =
|
||||
data->set.proxy_ssl.primary.verifypeer;
|
||||
}
|
||||
break;
|
||||
case CURLOPT_SSL_VERIFYHOST:
|
||||
/*
|
||||
@ -2166,6 +2178,12 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
|
||||
}
|
||||
|
||||
data->set.ssl.primary.verifyhost = (0 != arg) ? TRUE : FALSE;
|
||||
|
||||
/* Update the current connection ssl_config. */
|
||||
if(data->easy_conn) {
|
||||
data->easy_conn->ssl_config.verifyhost =
|
||||
data->set.ssl.primary.verifyhost;
|
||||
}
|
||||
break;
|
||||
case CURLOPT_PROXY_SSL_VERIFYHOST:
|
||||
/*
|
||||
@ -2184,6 +2202,12 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
|
||||
}
|
||||
|
||||
data->set.proxy_ssl.primary.verifyhost = (0 != arg)?TRUE:FALSE;
|
||||
|
||||
/* Update the current connection proxy_ssl_config. */
|
||||
if(data->easy_conn) {
|
||||
data->easy_conn->proxy_ssl_config.verifyhost =
|
||||
data->set.proxy_ssl.primary.verifyhost;
|
||||
}
|
||||
break;
|
||||
case CURLOPT_SSL_VERIFYSTATUS:
|
||||
/*
|
||||
@ -2196,6 +2220,12 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
|
||||
|
||||
data->set.ssl.primary.verifystatus = (0 != va_arg(param, long)) ?
|
||||
TRUE : FALSE;
|
||||
|
||||
/* Update the current connection ssl_config. */
|
||||
if(data->easy_conn) {
|
||||
data->easy_conn->ssl_config.verifystatus =
|
||||
data->set.ssl.primary.verifystatus;
|
||||
}
|
||||
break;
|
||||
case CURLOPT_SSL_CTX_FUNCTION:
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user