Alex Cruise wrote:
Hi there,

I'm evaluating 3.0 in an attempt to alleviate some issues I'm seeing with CLOSE_WAITs in SSL sockets in 2.0.2. I'm trying to execute a GET request to an SSL socket, and I'm calling HttpClient.executeMethod() with a HostConfiguration argument. Before line 387, my hostconfig.getProtocol().getSocketFactory() points to my socket factory, which points to an important overridden TrustManager. But for some reason, at line 387, the Host inside the HostConfig gets reset, replacing the version that has my socket factory.


Alex,

Do not use absolute URLs when explicitly specifying an instance of HostConfiguration. An absolute URL will always override the HostConfiguration settings.

HttpClient httpclient = new HttpClient();
HostConfiguration hostconf = new HostConfiguration();
hostconf.setHost("whatever.com", 80, myprotocol);
// Wrong! This will overrride 'hostconf'
GetMethod httpget1 = new GetMethod("http://whatever.com/stuff";);
httpclient.executeMethod(hostconf, httpget1);
// Correct. 'hostconf' will be used
GetMethod httpget2 = new GetMethod("/stuff");
httpclient.executeMethod(hostconf, httpget2);

Oleg

Is there some reason for this behaviour, or an unobvious way to get around it? I can't go into production with this version as-is.

Thanks,

-0xe1a

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




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

Reply via email to