I am working on enabling prox support. When I set the proxy server to
require authentication but don't set the right user name and password it
responds as follows:

2006/04/07 15:39:42:465 PDT [DEBUG] DefaultHttpParams - -Set parameter
http.useragent = Jakarta Commons-HttpClient/3.0
2006/04/07 15:39:42:480 PDT [DEBUG] DefaultHttpParams - -Set parameter
http.protocol.version = HTTP/1.1
2006/04/07 15:39:42:527 PDT [DEBUG] DefaultHttpParams - -Set parameter
http.connection-manager.class = class
org.apache.commons.httpclient.SimpleHttpConnectionManager
2006/04/07 15:39:42:527 PDT [DEBUG] DefaultHttpParams - -Set parameter
http.protocol.cookie-policy = rfc2109
2006/04/07 15:39:42:527 PDT [DEBUG] DefaultHttpParams - -Set parameter
http.protocol.element-charset = US-ASCII
2006/04/07 15:39:42:527 PDT [DEBUG] DefaultHttpParams - -Set parameter
http.protocol.content-charset = ISO-8859-1
2006/04/07 15:39:42:527 PDT [DEBUG] DefaultHttpParams - -Set parameter
http.method.retry-handler =
[EMAIL PROTECTED]
... left out some stuff here ...
2006/04/07 15:39:42:574 PDT [DEBUG] DefaultHttpParams - -Set parameter
http.method.retry-handler =
... left out some stuff here ...

2006/04/07 15:39:51:652 PDT [DEBUG] HttpConnection - -Open connection to
localhost:808
2006/04/07 15:39:53:777 PDT [DEBUG] header - ->> "GET
http://myserver/foo.xml HTTP/1.1[\r][\n]"
2006/04/07 15:39:53:777 PDT [DEBUG] HttpMethodBase - -Adding Host request
header
2006/04/07 15:39:53:824 PDT [DEBUG] header - ->> "User-Agent: Jakarta
Commons-HttpClient/3.0[\r][\n]"
2006/04/07 15:39:53:824 PDT [DEBUG] header - ->> "Host:
sus-or1vsrte[\r][\n]"
2006/04/07 15:39:53:824 PDT [DEBUG] header - ->> "Proxy-Connection:
Keep-Alive[\r][\n]"
2006/04/07 15:39:53:824 PDT [DEBUG] header - ->> "[\r][\n]"
2006/04/07 15:39:53:840 PDT [DEBUG] header - -<< "<Html><Body><H1>
Unauthorized ...</H1></Body></Html>[\r][\n]"
2006/04/07 15:39:53:840 PDT [DEBUG] header - -<< "null[\r][\n]"

The response is an HTTP protocol violation and the method throws an
exception.
I believe there is no good way to provide the user with diagnostic
information (unless I change HttpClient source (readStatusLine()) as
indicated in
http://www.mail-archive.com/[email protected]/msg01012.html)
 which descibes a somewhat similar situation).

Is this correct? Should this really not been enhanced in the main line as
described in the prior posting?
It seems to me that one would want to make more information available to
the user when initial connections cannot be created. Perhaps ignored status
lines should be captured in the exception thrown.

Reply via email to