Hi Adrian,
Here is the code I am using at the moment... (I hope
you can put it in notepad and see if the tabs are ok)
System.setProperty("org.apache.commons.logging.Log",
"org.apache.commons.logging.impl.SimpleLog");
System.setProperty("org.apache.commons.logging.simplelog.showdatetime",
"true");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient",
"trace");
Security.addProvider (new
cryptix.jce.provider.CryptixCrypto());
HttpClient client = new HttpClient();
NTCredentials cred = new
NTCredentials("logonid", "pass", "Machinename",
"Domain");
HostConfiguration host = new
HostConfiguration();
host.setProxy("proxyhost.com",80);
host.setHost("www.google.com", 80, "http");
client.setHostConfiguration(host);
// for the realm parameter of the following
method, if I set it to the proxy realm/ip, it
// still looks for the HOST (please look at the
Authenticator class method,
// which will be www.google.com in my case...
why does it search
// against the host, and not against the proxy
realm that I pass in ? If I put www.google.com
// as a parameter instead of null, it works fine
- Bizarre !!! Well, I now make it work
// by putting in null, but I don't like it.
client.getState().setProxyCredentials(null,
cred);
HttpMethod method = new GetMethod();
client.executeMethod(method);
System.out.println(method.getStatusCode() +
method.getResponseBodyAsString());
// try to reuse method
method.releaseConnection();
method.recycle();
// try another request on same connection...
// Hmm... getting authenticated again :o( and in
first try of the NTLM auth loop (authenticator),
// I get an exception (connection reset by peer)
method.setPath("/advanced_search?q=HTTP+status+403&hl=en&lr=&ie=UTF-8&oe=UTF-8");
((HttpMethodBase)method).setHttp11(true);
method.setRequestHeader("Connection",
"Keep-Alive");
System.out.println("isHttp11 " +
((HttpMethodBase)method).isHttp11());
client.executeMethod(method);
System.out.println(method.getStatusCode() +
method.getResponseBodyAsString());
I had to leave early from work so I couldnt bring the
logs with me, will try to bring it tomorrow.
Hope you can give some advice with regards to the
above.
best regards, Shahbaz
--- Adrian Sutton <[EMAIL PROTECTED]> wrote: >
Hi Shahbaz,
> The HttpClient codebase has changed a fair bit since
>
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]