Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4645

AsyncHTTPConduit does not re-use NTLM authenticated connections

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7
    • 2.7.1
    • Transports
    • 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());
                  }
      ...
      

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            oysteingr Øystein Grimstad
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: