url: proxy ssl connection reuse fix

- tunnel https proxy used for http: transfers does
  no check if proxy-ssl configuration matches
- test cases added, test_10_12 fails on 8.4.0

Closes #12255
This commit is contained in:
Stefan Eissing 2023-11-03 11:46:14 +01:00 committed by Daniel Stenberg
parent 7e828fe503
commit 3e6254f819
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 120 additions and 12 deletions

View file

@ -1203,17 +1203,19 @@ ConnectionExists(struct Curl_easy *data,
continue;
if(IS_HTTPS_PROXY(needle->http_proxy.proxytype)) {
/* use https proxy */
if(needle->http_proxy.proxytype !=
check->http_proxy.proxytype)
/* https proxies come in different types, http/1.1, h2, ... */
if(needle->http_proxy.proxytype != check->http_proxy.proxytype)
continue;
/* match SSL config to proxy */
if(!Curl_ssl_conn_config_match(data, check, TRUE)) {
DEBUGF(infof(data,
"Connection #%" CURL_FORMAT_CURL_OFF_T
" has different SSL proxy parameters, can't reuse",
check->connection_id));
continue;
else if(needle->handler->flags&PROTOPT_SSL) {
/* use double layer ssl */
if(!Curl_ssl_conn_config_match(data, check, TRUE))
continue;
}
else if(!Curl_ssl_conn_config_match(data, check, FALSE))
continue;
/* the SSL config to the server, which may apply here is checked
* further below */
}
}
#endif