Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.3.4
-
None
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)
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.