From 807c056c08bd6314e27148c348d027a808e3a632 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 21 Oct 2019 10:43:03 +0200 Subject: conn-reuse: requests wanting NTLM can reuse non-NTLM connections Added test case 338 to verify. Reported-by: Daniel Silverstone Fixes #4499 Closes #4514 --- lib/url.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/url.c') diff --git a/lib/url.c b/lib/url.c index 1b3c15c2f..660d24141 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1282,8 +1282,14 @@ ConnectionExists(struct Curl_easy *data, partway through a handshake!) */ if(wantNTLMhttp) { if(strcmp(needle->user, check->user) || - strcmp(needle->passwd, check->passwd)) + strcmp(needle->passwd, check->passwd)) { + + /* we prefer a credential match, but this is at least a connection + that can be reused and "upgraded" to NTLM */ + if(check->http_ntlm_state == NTLMSTATE_NONE) + chosen = check; continue; + } } else if(check->http_ntlm_state != NTLMSTATE_NONE) { /* Connection is using NTLM auth but we don't want NTLM */ -- cgit v1.2.3