views:

67

answers:

0

Hello, I'm trying to get preemptive digest-based auth working with httpclient 4. The Example from

http://svn.apache.org/repos/asf/httpcomponents/httpclient/tags/4.0.1/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveBasicAuthentication.java

works just fine, however, when I use a ThreadSafeClientConnManager around the HttpClient,

ThreadSafeClientConnManager connmgr = new ThreadSafeClientConnManager(params,
            schemeRegistry);
DefaultHttpClient client = new DefaultHttpClient(connmgr, params);

Digest Auth fails entirely (not only that is is not preemptive anymore, it simply will not be able to authenticate at all.

I've tracked it down to Lines 126 and 127 in the above link:

authState.setAuthScheme(authScheme);
authState.setCredentials(creds);

If I remove them, the auth will work (however, not preemptive).

Does anybode have an idea, what could help here?