proxy: make ConnectionExists() check credential of proxyconnections too
Previously it only compared credentials if the requested needle connection wasn't using a proxy. This caused NTLM authentication failures when using proxies as the authentication code wasn't send on the connection where the challenge arrived. Added test 1215 to verify: NTLM server authentication through a proxy (This is a modified copy of test 67)
This commit is contained in:

committed by
Daniel Stenberg

parent
9141c75bfb
commit
638c6da9db
23
lib/url.c
23
lib/url.c
@@ -2974,6 +2974,18 @@ ConnectionExists(struct SessionHandle *data,
|
||||
continue;
|
||||
}
|
||||
|
||||
if((needle->handler->protocol & CURLPROTO_FTP) ||
|
||||
((needle->handler->protocol & CURLPROTO_HTTP) && wantNTLM)) {
|
||||
/* This is FTP or HTTP+NTLM, verify that we're using the same name
|
||||
and password as well */
|
||||
if(!strequal(needle->user, check->user) ||
|
||||
!strequal(needle->passwd, check->passwd)) {
|
||||
/* one of them was different */
|
||||
continue;
|
||||
}
|
||||
credentialsMatch = TRUE;
|
||||
}
|
||||
|
||||
if(!needle->bits.httpproxy || needle->handler->flags&PROTOPT_SSL ||
|
||||
(needle->bits.httpproxy && check->bits.httpproxy &&
|
||||
needle->bits.tunnel_proxy && check->bits.tunnel_proxy &&
|
||||
@@ -3007,17 +3019,6 @@ ConnectionExists(struct SessionHandle *data,
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if((needle->handler->protocol & CURLPROTO_FTP) ||
|
||||
((needle->handler->protocol & CURLPROTO_HTTP) && wantNTLM)) {
|
||||
/* This is FTP or HTTP+NTLM, verify that we're using the same name
|
||||
and password as well */
|
||||
if(!strequal(needle->user, check->user) ||
|
||||
!strequal(needle->passwd, check->passwd)) {
|
||||
/* one of them was different */
|
||||
continue;
|
||||
}
|
||||
credentialsMatch = TRUE;
|
||||
}
|
||||
match = TRUE;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user