Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 73286 invoked from network); 29 Jun 2009 14:10:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Jun 2009 14:10:10 -0000 Received: (qmail 92046 invoked by uid 500); 29 Jun 2009 14:10:21 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 92006 invoked by uid 500); 29 Jun 2009 14:10:21 -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 91996 invoked by uid 99); 29 Jun 2009 14:10:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jun 2009 14:10:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jun 2009 14:10:09 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 88D5B234C004 for ; Mon, 29 Jun 2009 07:09:47 -0700 (PDT) Message-ID: <281271265.1246284587545.JavaMail.jira@brutus> Date: Mon, 29 Jun 2009 07:09:47 -0700 (PDT) From: "Raj (JIRA)" To: dev@hc.apache.org Subject: [jira] Commented: (HTTPCLIENT-856) Proxy NTLM Authentication Redirecting to different address fails saying Proxy Auth Required. In-Reply-To: <1697506908.1246276787386.JavaMail.jira@brutus> 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-856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12725187#action_12725187 ] Raj commented on HTTPCLIENT-856: -------------------------------- HI Oleg, it does not work if (!route.getTargetHost().equals(newTarget)) { targetAuthState.invalidate(); if (route.isTunnelled()) { AuthScheme authScheme = proxyAuthState.getAuthScheme(); if (authScheme != null && authScheme.isConnectionBased()) { proxyAuthState.invalidate(); } } } However, I tried to debug, it seems that route.isTunnelled() returnes false, so, it does not invalidate the proxy auth state. When I removed that check, it worked as it is able to invalidate. isTunnelled flag needs to be verified. Thanks and Regards, Raj > Proxy NTLM Authentication Redirecting to different address fails saying Proxy Auth Required. > --------------------------------------------------------------------------------------------- > > Key: HTTPCLIENT-856 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-856 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpAuth > Affects Versions: 3.1 Final, 4.0 Beta 2 > Environment: HttpClient , Proxy Authentication (Microsoft ISA server) > Reporter: Raj > Attachments: HTTPCLIENT-856.patch > > > The issue has been discussed in, > http://www.nabble.com/redirect-fails-when-NTLM-authentication-is-used-for-proxy-tt23867531.html > This was found in http client 3.1 release, where NTLM proxy authentication is must and the server ask the redirect to a new url, in this case, when redirecting, the earlier proxy auth status is not cleared, so, it does not do proxy authentication for the new URL and hence fails. > Target Host Authenticaiton NTLM authentication - redirect also had problem and fixed as said, > http://issues.apache.org/jira/browse/HTTPCLIENT-211 > Proxy Authentication - redirect has to be fixed, > The wire logs for the release https://repository.apache.org/content/repositories/snapshots/org/apache/httpcomponents/httpclient/4.0-beta3-SNAPSHOT/ > is given below, > [DEBUG] wire - >> "GET http://verisign.com HTTP/1.1[EOL]" > [DEBUG] wire - >> "Host: verisign.com[EOL]" > [DEBUG] wire - >> "Proxy-Connection: Keep-Alive[EOL]" > [DEBUG] wire - >> "User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.5)[EOL]" > [DEBUG] wire - >> "[EOL]" > [DEBUG] wire - << "HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )[EOL]" > [DEBUG] wire - << "Via: 1.1 lab1[EOL]" > [DEBUG] wire - << "Proxy-Authenticate: Negotiate[EOL]" > [DEBUG] wire - << "Proxy-Authenticate: Kerberos[EOL]" > [DEBUG] wire - << "Proxy-Authenticate: NTLM[EOL]" > [DEBUG] wire - << "Proxy-Authenticate: Basic realm="lab1."[EOL]" > [DEBUG] wire - << "Connection: Keep-Alive[EOL]" > [DEBUG] wire - << "Proxy-Connection: Keep-Alive[EOL]" > [DEBUG] wire - << "Pragma: no-cache[EOL]" > [DEBUG] wire - << "Cache-Control: no-cache[EOL]" > [DEBUG] wire - << "Content-Type: text/html[EOL]" > [DEBUG] wire - << "Content-Length: 4107 [EOL]" > [DEBUG] wire - << "[EOL]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << "Error Message[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << "
[\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << "
[DEBUG] wire - << "n=middle>X
[\r][\n]" > [DEBUG] wire - << "
Network Access Message: The page cannot be displayed
[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << "
[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << "
Explanation: There is a problem with the page you are trying to reach and it cannot be displayed.

[\r][\n]" > [DEBUG] wire - << " Try the following: [\r][\n]" > [DEBUG] wire - << "
    [\r][\n]" > [DEBUG] wire - << "
  • Refresh page: Search for the page again by clicking the Refresh button. The timeout may have occurred due to Internet congestion.[\r][\n]" > [DEBUG] wire - << "
  • Check spelling: Check that you typed the Web page address correctly. The address may have been mistyped.[\r][\n]" > [DEBUG] wire - << "
  • Access from a link: If there is a link to the page you are looking for, try accessing the page from that link.[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << "
[\r][\n]" > [DEBUG] wire - << "If you are still not able to view the requested page, try contacting your administrator or Helpdesk.

[\r][\n]" > [DEBUG] wire - << "
[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << "
[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << " [\r][\n]" > [DEBUG] wire - << "
Technical Information (for support personnel) [\r][\n]" > [DEBUG] wire - << "
    [\r][\n]" > [DEBUG] wire - << "
  • Error Code: 407 Proxy Authentication Required. The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. (12209)[\r][\n]" > [DEBUG] wire - << "
  • IP Address: x.x.x.x[\r][\n]" > [DEBUG] wire - << "
  • Date: 6/29/2009 11:15:15 AM [GMT][\r][\n]" > [DEBUG] wire - << "
  • Server: lab1[\r][\n]" > [DEBUG] wire - << "
  • Source: proxy[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << "
[\r][\n]" > [DEBUG] wire - << "
[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - << "[\r][\n]" > [DEBUG] wire - >> "GET http://verisign.com HTTP/1.1[EOL]" > [DEBUG] wire - >> "Host: verisign.com[EOL]" > [DEBUG] wire - >> "Proxy-Connection: Keep-Alive[EOL]" > [DEBUG] wire - >> "User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.5)[EOL]" > [DEBUG] wire - >> "Proxy-Authorization: NTLM TlRMTVNTUAABAAAAATIAAAgACAAgAAAADgAOACgAAABNWURPTUFJTkpDSUZTMjMwXzg2Xzkx[EOL]" > [DEBUG] wire - >> "[EOL]" > [DEBUG] wire - << "HTTP/1.1 407 Proxy Authentication Required ( Access is denied. )[EOL]" > [DEBUG] wire - << "Via: 1.1 lab1[EOL]" > [DEBUG] wire - << "Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAAAAADgAAAABAgACqbXrIWnZ3i4AAAAAAAAAAAAAAAA4AAAABQLODgAAAA8=[EOL]" > [DEBUG] wire - << "Connection: Keep-Alive[EOL]" > [DEBUG] wire - << "Proxy-Connection: Keep-Alive[EOL]" > [DEBUG] wire - << "Pragma: no-cache[EOL]" > [DEBUG] wire - << "Cache-Control: no-cache[EOL]" > [DEBUG] wire - << "Content-Type: text/html[EOL]" > [DEBUG] wire - << "Content-Length: 0 [EOL]" > [DEBUG] wire - << "[EOL]" > [DEBUG] wire - >> "GET http://verisign.com HTTP/1.1[EOL]" > [DEBUG] wire - >> "Host: verisign.com[EOL]" > [DEBUG] wire - >> "Proxy-Connection: Keep-Alive[EOL]" > [DEBUG] wire - >> "User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.5)[EOL]" > [DEBUG] wire - >> "Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAwADAAWAAAABAAEACIAAAAGgAaAJgAAAAcABwAsgAAAAAAAAAAAAAAAQIAAAXLpW40q7jqh7E6FgFnJqy9529ANaSLqfTiwjyF2BrUP9F8ObYOyYsBAQAAAAAAACDgxRg9+skBRt4mUOFFCs0AAAAAAAAAAE0AWQBEAE8ATQBBAEkATgBBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAEoAQwBJAEYAUwAyADMAMABfADgANgBfADkAMQA=[EOL]" > [DEBUG] wire - >> "[EOL]" > [DEBUG] wire - << "HTTP/1.1 301 Unknown reason[EOL]" > [DEBUG] wire - << "Via: 1.1 lab1[EOL]" > [DEBUG] wire - << "Connection: Keep-Alive[EOL]" > [DEBUG] wire - << "Proxy-Connection: Keep-Alive[EOL]" > [DEBUG] wire - << "Content-length: 0[EOL]" > [DEBUG] wire - << "Date: Mon, 29 Jun 2009 11:16:50 GMT[EOL]" > [DEBUG] wire - << "Location: http://www.verisign.com/[EOL]" > [DEBUG] wire - << "Content-type: text/html[EOL]" > [DEBUG] wire - << "Server: Netscape-Enterprise/4.1[EOL]" > [DEBUG] wire - << "[EOL]" > [ERROR] RequestProxyAuthentication - Proxy authentication error: Unexpected state: MSG_TYPE3_GENERATED > [DEBUG] wire - >> "GET http://www.verisign.com/ HTTP/1.1[EOL]" > [DEBUG] wire - >> "Host: www.verisign.com[EOL]" > [DEBUG] wire - >> "Proxy-Connection: Keep-Alive[EOL]" > [DEBUG] wire - >> "User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.5)[EOL]" > [DEBUG] wire - >> "[EOL]" > [DEBUG] wire - << "HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )[EOL]" > [DEBUG] wire - << "Via: 1.1 lab1[EOL]" > [DEBUG] wire - << "Proxy-Authenticate: Negotiate[EOL]" > [DEBUG] wire - << "Proxy-Authenticate: Kerberos[EOL]" > [DEBUG] wire - << "Proxy-Authenticate: NTLM[EOL]" > [DEBUG] wire - << "Proxy-Authenticate: Basic realm="lab1."[EOL]" > [DEBUG] wire - << "Connection: Keep-Alive[EOL]" > [DEBUG] wire - << "Proxy-Connection: Keep-Alive[EOL]" > [DEBUG] wire - << "Pragma: no-cache[EOL]" > [DEBUG] wire - << "Cache-Control: no-cache[EOL]" > [DEBUG] wire - << "Content-Type: text/html[EOL]" > [DEBUG] wire - << "Content-Length: 4107 [EOL]" > [DEBUG] wire - << "[EOL]" > ---------------------------------------- > HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ) > Thanks, > Raj -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org