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

authentication error: missing realm in challenge

    XMLWordPrintableJSON

Details

    Description

      I use HttpClient 4.3.4 and will pass the proxy with DIGEST Authentication.

      But AuthenticationException("missing realm in challenge") was thrown
      in org.apache.http.impl.auth.DigestScheme#authenticate.

      I research HTTP Header from Proxy Server.

      2014/06/26 14:43:12:691 GMT+09:00 [DEBUG] headers - http-outgoing-3 <<
      Proxy-Authenticate: Digest Realm="-", nonce="YjYuNGYyYmJhMzUuY2I5ZDhlZDE5M2ZlZDM
      1Mjk3NGJkNTIyYjgyNTcwMjQ=", opaque="98700A3D9CE17065E2246B41035C6609", qop="auth

      The keyword is "Realm".
      FIrst character is UpperCase.

      I research source code of org.apache.http.impl.auth.RFC2617Schem.java.
      Then
      protected void parseChallenge(final CharArrayBuffer buffer,
      final int pos, final int len)

      { ... this.params.put(element.getName(), element.getValue()); }

      public String getParameter(final String name)

      { ... return this.params.get(name.toLowerCase(Locale.ENGLISH)); }

      In my case, put the name by UpperCase and get by LowerCase.
      So AuthenticationException happens.

      Probably in parseChallenge()

      this.params.put(element.getName().toLowerCase(Locale.ENGLIEH), element.getValue());

      is correct.

      #HttpClient 3.x is correct.

      Attachments

        Activity

          People

            Unassigned Unassigned
            yuji_tagawa Yuji Tagawa
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: