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 5DBA1D995 for ; Mon, 10 Dec 2012 19:21:21 +0000 (UTC) Received: (qmail 26207 invoked by uid 500); 10 Dec 2012 19:21:21 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 26081 invoked by uid 500); 10 Dec 2012 19:21: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 26071 invoked by uid 99); 10 Dec 2012 19:21:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Dec 2012 19:21:21 +0000 Date: Mon, 10 Dec 2012 19:21:20 +0000 (UTC) From: "Daz DeBoer (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPCLIENT-1272) HttpClient does not retry failed PROXY authentication when multiple challenges are present MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13528193#comment-13528193 ] Daz DeBoer commented on HTTPCLIENT-1272: ---------------------------------------- Here are the HttpClient sections of the Gradle debug logs. Full log available here: https://gist.github.com/4175447. 08:32:13.762 [DEBUG] [org.gradle.api.internal.externalresource.transport.http.JavaSystemPropertiesHttpProxySettings] Found java system property 'http.nonProxyHosts': localhost. Will ignore proxy settings for these hosts. 08:32:13.794 [DEBUG] [org.gradle.api.internal.externalresource.transport.http.HttpClientConfigurer] Using Credentials [username: MY_USER_ID] and NTLM Credentials [user: MY_USER_ID, domain: MY_DOMAIN, workstation: MY_WORK_STATION] for authenticating against 'MYPROXY:8080' 08:32:14.122 [DEBUG] [org.gradle.api.internal.externalresource.transport.http.HttpClientHelper] Performing HTTP GET: http://repo1.maven.org/maven2/junit/junit/maven-metadata.xml 08:32:14.278 [DEBUG] [org.apache.http.impl.conn.PoolingClientConnectionManager] Connection request: [route: {}->http://MYPROXY:8080->http://repo1.maven.org][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20] 08:32:14.278 [DEBUG] [org.apache.http.impl.conn.PoolingClientConnectionManager] Connection leased: [id: 0][route: {}->http://MYPROXY:8080->http://repo1.maven.org][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20] 08:32:14.294 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnectionOperator] Connecting to MYPROXY:8080 08:32:14.309 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: best-match 08:32:14.309 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context 08:32:14.309 [DEBUG] [org.apache.http.client.protocol.RequestTargetAuthentication] Target auth state: UNCHALLENGED 08:32:14.309 [DEBUG] [org.apache.http.client.protocol.RequestProxyAuthentication] Proxy auth state: UNCHALLENGED 08:32:14.309 [DEBUG] [org.apache.http.impl.client.SystemDefaultHttpClient] Attempt 1 to execute request 08:32:14.309 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Sending request: GET http://repo1.maven.org/maven2/junit/junit/maven-metadata.xml HTTP/1.1 08:32:14.309 [DEBUG] [org.apache.http.headers] >> GET http://repo1.maven.org/maven2/junit/junit/maven-metadata.xml HTTP/1.1 08:32:14.309 [DEBUG] [org.apache.http.headers] >> Accept-Encoding: gzip,deflate 08:32:14.309 [DEBUG] [org.apache.http.headers] >> Host: repo1.maven.org 08:32:14.309 [DEBUG] [org.apache.http.headers] >> Proxy-Connection: Keep-Alive 08:32:14.309 [DEBUG] [org.apache.http.headers] >> User-Agent: Gradle/1.2 (Windows XP;5.1;x86) (Sun Microsystems Inc.;1.6.0_21;17.0-b17) 08:32:14.325 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Receiving response: HTTP/1.1 407 Proxy Authentication Required 08:32:14.325 [DEBUG] [org.apache.http.headers] << HTTP/1.1 407 Proxy Authentication Required 08:32:14.325 [DEBUG] [org.apache.http.headers] << Proxy-Authenticate: NEGOTIATE 08:32:14.325 [DEBUG] [org.apache.http.headers] << Proxy-Authenticate: NTLM 08:32:14.325 [DEBUG] [org.apache.http.headers] << Proxy-Authenticate: BASIC realm="QA" 08:32:14.325 [DEBUG] [org.apache.http.headers] << Cache-Control: no-cache 08:32:14.325 [DEBUG] [org.apache.http.headers] << Pragma: no-cache 08:32:14.325 [DEBUG] [org.apache.http.headers] << Content-Type: text/html; charset=utf-8 08:32:14.325 [DEBUG] [org.apache.http.headers] << Proxy-Connection: close 08:32:14.325 [DEBUG] [org.apache.http.headers] << Set-Cookie: BCSI-CS-d39782e8f7077930=2; Path=/ 08:32:14.325 [DEBUG] [org.apache.http.headers] << Connection: close 08:32:14.325 [DEBUG] [org.apache.http.headers] << Content-Length: 849 08:32:14.325 [DEBUG] [org.apache.http.client.protocol.ResponseProcessCookies] Cookie accepted: "[version: 0][name: BCSI-CS-d39782e8f7077930][value: 2][domain: repo1.maven.org][path: /][expiry: null]". 08:32:14.325 [DEBUG] [org.apache.http.impl.client.SystemDefaultHttpClient] MYPROXY:8080 requested authentication 08:32:14.325 [DEBUG] [org.apache.http.impl.client.ProxyAuthenticationStrategy] Authentication schemes in the order of preference: [negotiate, Kerberos, NTLM, Digest, Basic] 08:32:14.340 [DEBUG] [org.apache.http.impl.auth.SPNegoScheme] Received challenge '' from the auth server 08:32:14.340 [DEBUG] [org.apache.http.impl.client.ProxyAuthenticationStrategy] Challenge for Kerberos authentication scheme not available 08:32:14.340 [DEBUG] [org.apache.http.impl.client.ProxyAuthenticationStrategy] Challenge for Digest authentication scheme not available 08:32:14.340 [DEBUG] [org.apache.http.impl.client.SystemDefaultHttpClient] Selected authentication options: [NEGOTIATE, NTLM, BASIC] 08:32:14.340 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Connection 0.0.0.0:1832<->172.27.254.2:8080 closed 08:32:14.340 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnectionOperator] Connecting to MYPROXY:8080 08:32:14.340 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: best-match 08:32:14.340 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] Cookie [version: 0][name: BCSI-CS-d39782e8f7077930][value: 2][domain: repo1.maven.org][path: /][expiry: null] match [repo1.maven.org:80/maven2/junit/junit/maven-metadata.xml] 08:32:14.340 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context 08:32:14.340 [DEBUG] [org.apache.http.client.protocol.RequestTargetAuthentication] Target auth state: UNCHALLENGED 08:32:14.340 [DEBUG] [org.apache.http.client.protocol.RequestProxyAuthentication] Proxy auth state: CHALLENGED 08:32:14.340 [DEBUG] [org.apache.http.client.protocol.RequestProxyAuthentication] Generating response to an authentication challenge using Negotiate scheme 08:32:14.340 [DEBUG] [org.apache.http.impl.auth.SPNegoScheme] init MYPROXY:8080 08:32:14.372 [WARN] [org.apache.http.client.protocol.RequestProxyAuthentication] NEGOTIATE authentication error: Invalid name provided (Mechanism level: Could not load configuration file C:\WINDOWS\krb5.ini (The system cannot find the file specified)) 08:32:14.372 [DEBUG] [org.apache.http.client.protocol.RequestProxyAuthentication] Generating response to an authentication challenge using ntlm scheme 08:32:14.387 [DEBUG] [org.apache.http.impl.client.SystemDefaultHttpClient] Attempt 2 to execute request 08:32:14.387 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Sending request: GET http://repo1.maven.org/maven2/junit/junit/maven-metadata.xml HTTP/1.1 08:32:14.387 [DEBUG] [org.apache.http.headers] >> GET http://repo1.maven.org/maven2/junit/junit/maven-metadata.xml HTTP/1.1 08:32:14.387 [DEBUG] [org.apache.http.headers] >> Accept-Encoding: gzip,deflate 08:32:14.387 [DEBUG] [org.apache.http.headers] >> Host: repo1.maven.org 08:32:14.387 [DEBUG] [org.apache.http.headers] >> Proxy-Connection: Keep-Alive 08:32:14.387 [DEBUG] [org.apache.http.headers] >> User-Agent: Gradle/1.2 (Windows XP;5.1;x86) (Sun Microsystems Inc.;1.6.0_21;17.0-b17) 08:32:14.387 [DEBUG] [org.apache.http.headers] >> Cookie: BCSI-CS-d39782e8f7077930=2 08:32:14.387 [DEBUG] [org.apache.http.headers] >> Cookie2: $Version=1 08:32:14.387 [DEBUG] [org.apache.http.headers] >> Proxy-Authorization: NTLM TlRMTVNTUAABAAAAATIAAAIAAgAgAAAABwAHACIAAABRUlFSMjMyODI= 08:32:14.387 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Receiving response: HTTP/1.1 407 Proxy Authentication Required 08:32:14.387 [DEBUG] [org.apache.http.headers] << HTTP/1.1 407 Proxy Authentication Required 08:32:14.387 [DEBUG] [org.apache.http.headers] << Proxy-Authenticate: NTLM TlRMTVNTUAACAAAABAAEADgAAAAFAoEC16VC0SMlKxsAAAAAAAAAAKAAoAA8AAAABgGxHQAAAA9RAFIAAgAEAFEAUgABABQARABPAEgAUQBEAFQATQBHADAAMQAEABwAcQByAC4AcQByAGcAcgBwAC4AbABvAGMAYQBsAAMAMgBEAE8ASABRAEQAVABNAEcAMAAxAC4AcQByAC4AcQByAGcAcgBwAC4AbABvAGMAYQBsAAUAFgBxAHIAZwByAHAALgBsAG8AYwBhAGwABwAIAMGLnOfNv80BAAAAAA== 08:32:14.387 [DEBUG] [org.apache.http.headers] << Cache-Control: no-cache 08:32:14.387 [DEBUG] [org.apache.http.headers] << Pragma: no-cache 08:32:14.387 [DEBUG] [org.apache.http.headers] << Content-Type: text/html; charset=utf-8 08:32:14.387 [DEBUG] [org.apache.http.headers] << Proxy-Connection: Keep-Alive 08:32:14.387 [DEBUG] [org.apache.http.headers] << Set-Cookie: BCSI-CS-d39782e8f7077930=2; Path=/ 08:32:14.387 [DEBUG] [org.apache.http.headers] << Connection: Keep-Alive 08:32:14.387 [DEBUG] [org.apache.http.headers] << Content-Length: 866 08:32:14.387 [DEBUG] [org.apache.http.client.protocol.ResponseProcessCookies] Cookie accepted: "[version: 0][name: BCSI-CS-d39782e8f7077930][value: 2][domain: repo1.maven.org][path: /][expiry: null]". 08:32:14.387 [DEBUG] [org.apache.http.impl.client.SystemDefaultHttpClient] MYPROXY:8080 requested authentication 08:32:14.387 [DEBUG] [org.apache.http.impl.client.SystemDefaultHttpClient] Authorization challenge processed 08:32:14.387 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Connection 0.0.0.0:1833<->172.27.254.2:8080 closed 08:32:14.387 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnectionOperator] Connecting to MYPROXY:8080 08:32:14.403 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: best-match 08:32:14.403 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] Cookie [version: 0][name: BCSI-CS-d39782e8f7077930][value: 2][domain: repo1.maven.org][path: /][expiry: null] match [repo1.maven.org:80/maven2/junit/junit/maven-metadata.xml] 08:32:14.403 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context 08:32:14.403 [DEBUG] [org.apache.http.client.protocol.RequestTargetAuthentication] Target auth state: UNCHALLENGED 08:32:14.403 [DEBUG] [org.apache.http.client.protocol.RequestProxyAuthentication] Proxy auth state: HANDSHAKE 08:32:14.403 [DEBUG] [org.apache.http.impl.client.SystemDefaultHttpClient] Attempt 3 to execute request 08:32:14.403 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Sending request: GET http://repo1.maven.org/maven2/junit/junit/maven-metadata.xml HTTP/1.1 08:32:14.403 [DEBUG] [org.apache.http.headers] >> GET http://repo1.maven.org/maven2/junit/junit/maven-metadata.xml HTTP/1.1 08:32:14.403 [DEBUG] [org.apache.http.headers] >> Accept-Encoding: gzip,deflate 08:32:14.403 [DEBUG] [org.apache.http.headers] >> Host: repo1.maven.org 08:32:14.403 [DEBUG] [org.apache.http.headers] >> Proxy-Connection: Keep-Alive 08:32:14.403 [DEBUG] [org.apache.http.headers] >> User-Agent: Gradle/1.2 (Windows XP;5.1;x86) (Sun Microsystems Inc.;1.6.0_21;17.0-b17) 08:32:14.403 [DEBUG] [org.apache.http.headers] >> Cookie: BCSI-CS-d39782e8f7077930=2 08:32:14.403 [DEBUG] [org.apache.http.headers] >> Cookie2: $Version=1 08:32:14.403 [DEBUG] [org.apache.http.headers] >> Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAADQANAAWAAAAAQABAAoAQAACgAKACwBAAAOAA4ANgEAAAAAAAAAAAAAAQIAAM5QLijY08Qbumz0PyLlOdfGyeC+BfHbPr2n4xNF1goQMCcfnq2VjfEBAQAAAAAAADBB7+fNv80BfHRLn6Kg+EYAAAAAAgAEAFEAUgABABQARABPAEgAUQBEAFQATQBHADAAMQAEABwAcQByAC4AcQByAGcAcgBwAC4AbABvAGMAYQBsAAMAMgBEAE8ASABRAEQAVABNAEcAMAAxAC4AcQByAC4AcQByAGcAcgBwAC4AbABvAGMAYQBsAAUAFgBxAHIAZwByAHAALgBsAG8AYwBhAGwABwAIAMGLnOfNv80BAAAAAAAAAABRAFIAVAA0ADAANwA0AFEAUgAyADMAMgA4ADIA 08:32:14.419 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Receiving response: HTTP/1.1 407 Proxy Authentication Required 08:32:14.419 [DEBUG] [org.apache.http.headers] << HTTP/1.1 407 Proxy Authentication Required 08:32:14.419 [DEBUG] [org.apache.http.headers] << Proxy-Authenticate: NTLM 08:32:14.419 [DEBUG] [org.apache.http.headers] << Cache-Control: no-cache 08:32:14.419 [DEBUG] [org.apache.http.headers] << Pragma: no-cache 08:32:14.419 [DEBUG] [org.apache.http.headers] << Content-Type: text/html; charset=utf-8 08:32:14.419 [DEBUG] [org.apache.http.headers] << Proxy-Connection: close 08:32:14.419 [DEBUG] [org.apache.http.headers] << Set-Cookie: BCSI-CS-d39782e8f7077930=2; Path=/ 08:32:14.419 [DEBUG] [org.apache.http.headers] << Connection: close 08:32:14.419 [DEBUG] [org.apache.http.headers] << Content-Length: 862 08:32:14.419 [DEBUG] [org.apache.http.client.protocol.ResponseProcessCookies] Cookie accepted: "[version: 0][name: BCSI-CS-d39782e8f7077930][value: 2][domain: repo1.maven.org][path: /][expiry: null]". 08:32:14.419 [DEBUG] [org.apache.http.impl.client.SystemDefaultHttpClient] MYPROXY:8080 requested authentication 08:32:14.419 [DEBUG] [org.apache.http.impl.client.SystemDefaultHttpClient] Authorization challenge processed 08:32:14.419 [DEBUG] [org.apache.http.impl.client.SystemDefaultHttpClient] Authentication failed 08:32:14.419 [DEBUG] [org.apache.http.impl.conn.PoolingClientConnectionManager] Connection [id: 0][route: {}->http://MYPROXY:8080->http://repo1.maven.org] can be kept alive for 9223372036854775807 MILLISECONDS 08:32:14.419 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Connection 0.0.0.0:1834<->172.27.254.2:8080 closed 08:32:14.419 [DEBUG] [org.apache.http.impl.conn.PoolingClientConnectionManager] Connection released: [id: 0][route: {}->http://MYPROXY:8080->http://repo1.maven.org][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20] 08:32:14.419 [INFO] [org.gradle.api.internal.externalresource.transport.http.HttpClientHelper] Failed to get resource: GET. [HTTP HTTP/1.1 407 Proxy Authentication Required: http://repo1.maven.org/maven2/junit/junit/maven-metadata.xml] > HttpClient does not retry failed PROXY authentication when multiple challenges are present > ------------------------------------------------------------------------------------------ > > Key: HTTPCLIENT-1272 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1272 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient > Affects Versions: 4.2.2 > Reporter: Daz DeBoer > > Similar to HTTPCLIENT-1107, but for Proxy authentication. It appears that subsequent authentication schemes are not attempted if an earlier scheme fails. > In our case, a proxy supports Negotiate, NTLM and BASIC authentication. When NTML authentication fails due to the wrong credentials being supplied, BASIC authentication is never attempted against the proxy. > I am a Gradle core developer, and we use HttpClient internally for dependency resolution. This issue was reported by one of our users. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators 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