mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:31:41 +03:00
conn: fix connection reuse when SSL is optional
In curl 8.12 I tried to improve the logic on how we handle connections that "upgrade" to TLS later, e.g. with a STARTTLS. I found the existing code hard to read in this regard. But of course, the "improvements" blew up in my face. We fixed issues with imap, opo3, smtp in 8.12.1, but ftp was no longer reusing existing, upgraded control connections as before. This PR adds checks in our pytest FTP tests that verify reuse is happening as intended. I rewrote the logic in url.c again, so that the new test checks now pass. Reported-by: Zenju on github Fixes #16384 Closes #16392
This commit is contained in:
parent
f78700814d
commit
df5db8afaf
11 changed files with 329 additions and 44 deletions
|
|
@ -530,9 +530,6 @@ static CURLcode oldap_connect(struct Curl_easy *data, bool *done)
|
|||
/* Initialize the SASL storage */
|
||||
Curl_sasl_init(&li->sasl, data, &saslldap);
|
||||
|
||||
/* Clear the TLS upgraded flag */
|
||||
conn->bits.tls_upgraded = FALSE;
|
||||
|
||||
result = oldap_parse_login_options(conn);
|
||||
if(result)
|
||||
return result;
|
||||
|
|
@ -797,7 +794,6 @@ static CURLcode oldap_connecting(struct Curl_easy *data, bool *done)
|
|||
if(result)
|
||||
result = oldap_map_error(code, CURLE_USE_SSL_FAILED);
|
||||
else if(ssl_installed(conn)) {
|
||||
conn->bits.tls_upgraded = TRUE;
|
||||
if(li->sasl.prefmech != SASL_AUTH_NONE)
|
||||
result = oldap_perform_mechs(data);
|
||||
else if(data->state.aptr.user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue