commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sachin Hamirwasia" <>
Subject RE: SSL proxy support in HttpClient
Date Wed, 12 Jun 2002 15:05:04 GMT
Hi Evert,

Appreciate your help in posting the changes to the CVS.

Here is what I have changed (please refer to attached files):

HttpConnection - changed the open() method (lines 283-288) to use the
_proxyHost and _proxyPort to open a plain socket, send an HTTP CONNECT
request (which makes an http proxy server switch to tunnel mode), and then
overlay this socket onto an SSLSocket using the default SSL socket factory.
This is also demonstrated in the JSSE sample code. The doTunnelHandshake()
[new addition] does the trick. Have also slightly changed this method from
the JSSE sample code to send some headers without which some proxies might
not work properly. [These are also the same headers that IE6.0 sends to a
proxy server for https tunnel]

HttpMethodBase - changed the generateRequestLine() method such that for SSL
connections going via a proxy server, it should send a relative URI rather
than a full URI [since the request is actually sent to the end HTTP server
and not the proxy server].

That's all the changes required to support proxy for secure connections. I
have tested the new build with some of my SSL servers and it seems to work
fine. Though haven't run the code through the commons test suite.


-----Original Message-----
From: Evert Hoff []
Sent: Wednesday, 12 June 2002 01:06 AM
To: Jakarta Commons Developers List
Subject: Re: SSL proxy support in HttpClient

Hi Sachin,

I would like to see it. I am planning to work on the same thing for
HttpMultiClient tomorrow and your code would help me understand what to

I'll then make a patch including my and your changes and submit these so
that someone who is a committer on this project can add it to CVS.



On Tue, 2002-06-11 at 18:18, Sachin Hamirwasia wrote:
> Hi,
> Not sure if this has been discussed earlier, I have modified the
> HttpClient's code slightly to make SSL work across a proxy server. Strange
> enough, https proxy support was missing in the most current source code.
> it might be of interest to anyone, I can mail the code over.
> Regards,
> Sachin
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message