hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Sutton <adr...@intencha.com>
Subject Re: preemptive
Date Tue, 10 Jun 2003 02:58:11 GMT
Zulfi,
*Please* at a minimum take a look at 
http://jakarta.apache.org/commons/httpclient/logging.html and include a 
debug log with any issue, it makes things so much easier at our end 
because it saves us guessing.

You'll probably also want to take a look at 
http://jakarta.apache.org/commons/httpclient/authentication.html though 
I'm not sure it clearly provides the solution to your problem.  I'll 
check that tonight and provide a patch if it needs improvments.

My best guess at this stage though is that you're not actually setting 
the credentials to send.  The line quoted below will set the 
credentials for:

Host: url.getHost()
Realm: (EMPTY STRING)

Now there are two problems with this:
1. Preemptive authentication happens before the realm is known so it 
looks for credentials in the default realm which is signified by null.

2. Unless the realm your connecting to really doesn't have a name, 
these credentials will likely never be found.

So what you probably meant to say is:

state.setCredentials(null, url.getHost(), new 
UsernamePasswordCredentials("zulfi", "zulfi"));

If that doesn't work, also try passing in a null host but in that case 
please log a bug for this as we should handle different default 
credentials for different hosts (I think we do, just not too sure).

Regards,

Adrian Sutton.

On Tuesday, June 10, 2003, at 08:44  AM, Zulfi Umrani wrote:

>
> 	state.setCredentials("", url.getHost(),
> 	    new UsernamePasswordCredentials("zulfi", "zulfi"));


Mime
View raw message