hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yuji Tagawa (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HTTPCLIENT-1524) authentication error: missing realm in challenge
Date Mon, 30 Jun 2014 01:09:24 GMT
Yuji Tagawa created HTTPCLIENT-1524:

             Summary: authentication error: missing realm in challenge
                 Key: HTTPCLIENT-1524
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1524
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
    Affects Versions: 4.3.4
            Reporter: Yuji Tagawa

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.
  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.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message