Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6BD4143BF for ; Fri, 13 May 2011 15:04:30 +0000 (UTC) Received: (qmail 61901 invoked by uid 500); 13 May 2011 15:04:30 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 61854 invoked by uid 500); 13 May 2011 15:04:30 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 61838 invoked by uid 99); 13 May 2011 15:04:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 May 2011 15:04:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 May 2011 15:04:27 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 84DC888E4A for ; Fri, 13 May 2011 15:03:47 +0000 (UTC) Date: Fri, 13 May 2011 15:03:47 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Message-ID: <1039232024.10272.1305299027540.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1212152655.10210.1305297107604.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (HTTPCLIENT-1087) Proxy authentication error: Unexpected state: MSG_TYPE3_GENERATED when using NTLM authentication MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HTTPCLIENT-1087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oleg Kalnichevski updated HTTPCLIENT-1087: ------------------------------------------ Fix Version/s: 4.1.2 > Proxy authentication error: Unexpected state: MSG_TYPE3_GENERATED when using NTLM authentication > ------------------------------------------------------------------------------------------------ > > Key: HTTPCLIENT-1087 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1087 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient > Affects Versions: 4.1.1 > Environment: Client app running Java 6 on a Win 7 X64 box, proxy Squid 2.7 running on a Win7 machine. > Reporter: David Gibbs > Fix For: 4.1.2 > > Attachments: wire-debug.log > > > 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); > > > } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org