connect: fix https connection setup to treat ssl_mode correctly

- for HTTPS protocol, a disabled ssl should never be acceptables.

Closes #10934
This commit is contained in:
Stefan Eissing 2023-04-11 16:34:01 +02:00 committed by Daniel Stenberg
parent fb08dd9c90
commit dd8130406e
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1409,9 +1409,8 @@ CURLcode Curl_conn_setup(struct Curl_easy *data,
#if !defined(CURL_DISABLE_HTTP) && !defined(USE_HYPER)
if(!conn->cfilter[sockindex] &&
conn->handler->protocol == CURLPROTO_HTTPS &&
(ssl_mode == CURL_CF_SSL_ENABLE || ssl_mode != CURL_CF_SSL_DISABLE)) {
conn->handler->protocol == CURLPROTO_HTTPS) {
DEBUGASSERT(ssl_mode != CURL_CF_SSL_DISABLE);
result = Curl_cf_https_setup(data, conn, sockindex, remotehost);
if(result)
goto out;