Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.7
-
None
-
Unknown
Description
I´ve started using AsyncHTTPConduit with NTLM, and have seen that connections are never re-used over consecutive requests.
I have debugged the entire stack, and found that the pooling mechanism in apache http client async is using the "http.user-token" (ClientContext.USER_TOKEN) property to find existing connections for re-use.
I managed to patch the AsyncHTTPConduit (from 2.7.0 tag) so that it actually does re-use connections with NTLM. However, I´m not very familiar with the cfx code base and do not know the side-effects of this change.
protected void connect(boolean output) throws IOException { ... if (tlsClientParameters != null && tlsClientParameters.hashCode() == lastTlsHash && sslState != null) { ctx.setAttribute(ClientContext.USER_TOKEN , sslState); } else if (client.getCredentialsProvider().getCredentials(AuthScope.ANY) != null) { ctx.setAttribute(ClientContext.USER_TOKEN, client.getCredentialsProvider() .getCredentials(AuthScope.ANY).getUserPrincipal()); } ...