Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 66A97200D31 for ; Fri, 20 Oct 2017 11:53:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 652241609E1; Fri, 20 Oct 2017 09:53:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AE4E3160BCB for ; Fri, 20 Oct 2017 11:53:09 +0200 (CEST) Received: (qmail 20137 invoked by uid 500); 20 Oct 2017 09:53:05 -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 19987 invoked by uid 99); 20 Oct 2017 09:53:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Oct 2017 09:53:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 3F56B1A10BF for ; Fri, 20 Oct 2017 09:53:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id ihreFmepPNm9 for ; Fri, 20 Oct 2017 09:53:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 9BC3361095 for ; Fri, 20 Oct 2017 09:53:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id CB30BE0FCE for ; Fri, 20 Oct 2017 09:53:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 461892439D for ; Fri, 20 Oct 2017 09:53:00 +0000 (UTC) Date: Fri, 20 Oct 2017 09:53:00 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPCLIENT-1855) Digest auth: Nonce counter not incremented after reuse MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 20 Oct 2017 09:53:10 -0000 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16212441#comment-16212441 ] ASF subversion and git services commented on HTTPCLIENT-1855: ------------------------------------------------------------- Commit ba47719c3adcc328fd800296ab5189d965ee216c in httpcomponents-client's branch refs/heads/4.6.x from [~olegk] [ https://git-wip-us.apache.org/repos/asf?p=httpcomponents-client.git;h=ba47719 ] HTTPCLIENT-1855: disabled caching of DIGEST auth scheme instances due to unreliability of nonce counter when the auth cache is shared by multiple sessions > Digest auth: Nonce counter not incremented after reuse > ------------------------------------------------------ > > Key: HTTPCLIENT-1855 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1855 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient (classic) > Affects Versions: 4.5.2 > Reporter: Alessandro Gherardi > Attachments: HttpClient5Digest.java, HttpClientDigest.java, httpclient5.log, wireshark.txt > > > I have a client app using httpclient 4.5.2 with BasicCredentialsProvider and BasicAuthCache. and web server that requires HTTP digest authentication. > The client sends 3 requests to the web server. > When the app sends the first request, the server returns an HTTP 401 with a digest challenge. httpclient automatically retries the request with the Authorization header. The header contains the nonce returned by the server and a nonce counter (nc) of 1. The retry succeeds and httpclient caches the DigestScheme. > For the second request, httpclient uses the cached DigestScheme to calculate the Authorization header pre-emptively. The header contains the same nonce and specifies a nonce counter of 2. The request succeed without requiring a retry. > For the third request, httpclient uses the cached DigestScheme to calculate the Authorization header pre-emptively. Even though the header contains the same nonce, the nonce counter is set to 2 again. This causes the server to return a 401. httpclient should have incremented the nonce counter to 3. > I believe that the root cause of this problem is that, although DigestScheme increases the nonceCount field every time the authenticate() method is called, HttpAuthenticator does not re-cache DigestScheme after reusing it. The re-cache is needed because BasicAuthCache stores DigestScheme in serialized format. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org