Oleg

Nightly builds that you are using contain experimental and unstable
code. 2.1 branch is in a state of profound flux. We are still trying to
finalise the API and simply have no bandwidth to deal with the bugs in
the experimental code. Please retest your application using the latest
official release (2.0rc2 as of writing) and if the problem persists
please submit the <strong>complete</strong> wire log. I'll happily take
look and try to come up with a solution.

I posted yesterday a message with the parts of the log that begins with "wire", (is that the wire log?) saying that the output log is identical in the two versions of the code (rc2 and nightly). Of course, the fix perhaps
is not going the be same for the two versions.


Not entirely correct. HttpClient relies on this method to force-close
the connection if it receives content body for a response type for which
content body is not allowed. 407 clearly does not fall into such a
category.

Fact is that the MS Proxy returns it (see the wire log).


It already happened more than once or twice here that people reported
what they thought was a bug in Httpclient, when in fact the problem were
caused by their use of invalid credentials.

This does not look to be the case, as if I do the changes mentioned I correctly fetch the pages.

On a second note, and again, using the same nightly build, I've found that another
change is needed if the basic authentication to a remote host accesed via the
proxy is wanted. In this case, the problem is that after the first attempt the
host returns a 401 and the HttpMethodDirector correctly tries to send the
authentication credentials. However, the proxy (in my case a MS Proxy) requires
to authenticate again and the library refuses to reuse the realm used for the first
interchange of information. The solution, in this case, is to change HttpMethodDirector at line #513


                 case HttpStatus.SC_UNAUTHORIZED:
                       challenges = 
method.getResponseHeaders(HttpAuthenticator.WWW_AUTH);
                host = conn.getVirtualHost();
                if (host == null) {
                                host = conn.getHost();
                        }


to look like


                 case HttpStatus.SC_UNAUTHORIZED:
                       challenges = 
method.getResponseHeaders(HttpAuthenticator.WWW_AUTH);
                        proxyRealms.clear();
                host = conn.getVirtualHost();
                if (host == null) {
                                host = conn.getHost();
                        }

So that the same credentials can be used again for the proxy when trying to authenticate
with the host. With this change the library is perfectly useful for me as I wanted simply some way of fetching a page across the proxy.


I'm afraid for the inconveniences I am causing you for not having used the correct 
version
of the library to investigate, and I sincerely hope that my indications could serve 
anyone
as, at least, a way of not doing things, or at best, some saving on further bug hunting
performed by you. I don't know if I will have time to trace again and suggest a 
solution for
the problem for the rc2 sources. In any case if I can provide you with more information
I will try to help.

Thanks

Alfonso



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to