Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1087

Proxy authentication error: Unexpected state: MSG_TYPE3_GENERATED when using NTLM authentication

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.1.1
    • 4.1.2
    • HttpClient (classic)
    • None
    • Client app running Java 6 on a Win 7 X64 box, proxy Squid 2.7 running on a Win7 machine.

    Description

      Trying to connect to a website that requires basic authentication through a proxy that requires NTLM authentication.

      Proxy authentication fails with "Proxy authentication error: Unexpected state: MSG_TYPE3_GENERATED".

      Full wire log attached. Code to replicate problem follows:

      private void execute() throws HttpException, IOException

      { URL targetUrl = new URL(TARGET_URL); DefaultHttpClient httpclient = new DefaultHttpClient(); HttpHost targetHost = new HttpHost(targetUrl.getHost()); HttpHost proxyHost = new HttpHost(PROXY_HOST, PROXY_PORT); httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxyHost); CredentialsProvider credProvider = httpclient.getCredentialsProvider(); Credentials proxyCredentials = new NTCredentials(PROXY_USER, PROXY_PASSWORD, PROXY_MACHINE, PROXY_DOMAIN); AuthScope proxyAuthScope = new AuthScope(proxyHost.getHostName(), proxyHost.getPort()); credProvider.setCredentials(proxyAuthScope, proxyCredentials); Credentials targetCredentials = new UsernamePasswordCredentials( TARGET_USER, TARGET_PASSWORD); AuthScope targetAuthScope = new AuthScope(targetHost.getHostName(), targetHost.getPort()); credProvider.setCredentials(targetAuthScope, targetCredentials); HttpGet httpget = new HttpGet(targetUrl.getPath()); HttpResponse response = httpclient.execute(targetHost, httpget); System.out.println("response = " + response); }

      Attachments

        1. HTTPCLIENT-1087-take2.patch
          1 kB
          Oleg Kalnichevski
        2. wire-debug-1.log
          77 kB
          David Gibbs
        3. HTTPCLIENT-1087.patch
          1 kB
          Oleg Kalnichevski
        4. wire-debug.log
          22 kB
          David Gibbs

        Activity

          People

            Unassigned Unassigned
            fallingrock David Gibbs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: