You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Yuji Tagawa (JIRA)" <ji...@apache.org> on 2014/06/30 03:09:24 UTC

[jira] [Created] (HTTPCLIENT-1524) authentication error: missing realm in challenge

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







--
This message was sent by Atlassian JIRA
(v6.2#6252)

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