HTTPCLIENT-1087: NTLM proxy authentication fails on retry if the underlying connection is closed as a result of a target authentication failure
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1104207 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
195026ce43
commit
e2fa3ae38f
|
@ -1,5 +1,9 @@
|
||||||
Changes since 4.1.1
|
Changes since 4.1.1
|
||||||
|
|
||||||
|
* [HTTPCLIENT-1087] NTLM proxy authentication fails on retry if the underlying connection is closed
|
||||||
|
as a result of a target authentication failure.
|
||||||
|
Contributed by Oleg Kalnichevski <olegk at apache.org>
|
||||||
|
|
||||||
* [HTTPCLIENT-1079] Fixed Kerberos cross-realm support
|
* [HTTPCLIENT-1079] Fixed Kerberos cross-realm support
|
||||||
Contributed by Michael Osipov <1983-01-06 at gmx.net>
|
Contributed by Michael Osipov <1983-01-06 at gmx.net>
|
||||||
|
|
||||||
|
|
|
@ -492,6 +492,8 @@ public class DefaultRequestDirector implements RequestDirector {
|
||||||
managedConn.markReusable();
|
managedConn.markReusable();
|
||||||
} else {
|
} else {
|
||||||
managedConn.close();
|
managedConn.close();
|
||||||
|
invalidateAuthIfSuccessful(this.proxyAuthState);
|
||||||
|
invalidateAuthIfSuccessful(this.targetAuthState);
|
||||||
}
|
}
|
||||||
// check if we can use the same connection for the followup
|
// check if we can use the same connection for the followup
|
||||||
if (!followup.getRoute().equals(roureq.getRoute())) {
|
if (!followup.getRoute().equals(roureq.getRoute())) {
|
||||||
|
@ -1232,4 +1234,14 @@ public class DefaultRequestDirector implements RequestDirector {
|
||||||
authState.setCredentials(creds);
|
authState.setCredentials(creds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void invalidateAuthIfSuccessful(final AuthState authState) {
|
||||||
|
AuthScheme authscheme = authState.getAuthScheme();
|
||||||
|
if (authscheme != null
|
||||||
|
&& authscheme.isConnectionBased()
|
||||||
|
&& authscheme.isComplete()
|
||||||
|
&& authState.getCredentials() != null) {
|
||||||
|
authState.invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // class DefaultClientRequestDirector
|
} // class DefaultClientRequestDirector
|
||||||
|
|
Loading…
Reference in New Issue