> -----Original Message----- > From: Michael Becke [mailto:[EMAIL PROTECTED] > > Hi David, > > The values given to the hostConfig on HttpClient are defaults > and only > used if values are not specified on the methods. My guess is > that the > URI returned from getGatewayURL() is absolute. If this is the case, > the host/protocol/port values are taken from this URI and the values > from the HttpClient hostConfig are not used. You can fix this in two > ways. > > 1) Register the your protocol statically: > > Protocol.registerProtocol("https", SOME_PROTOCOL); > > This will need to be done before creating the HttpMethod, since the > protocol is looked up when the URI is parsed. > > 2) Set the protocol on the method: > > GetMethod get = new GetMethod("http://somehost.com:/path"); > get.getHostConfiguration().setHost(host, port, protocol);
I implemented choice 2, which works. As you described, I was just missing setting the host configuration on the recreated method. I don't feel comfortable setting the protocol statically, as this code is running on a pre-servlet 2.2 web container, with essentially no classloader boundaries between applications. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
