You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Jani Mattsson <ja...@hotelzon.com> on 2003/02/27 13:49:29 UTC

Having problems with HTTPS proxy tunneling

Hi!
 
I am using commons-httpclient in a setup where I'm making connections to a
secure HTTPS server over a proxy server. I use POST-requests, and the first
request always works fine (albeit a bit slow because of SSL handshaking or
something). Subsequent request work fine if I do them soon enough after
the first request, but if there's been a longer pause I seem to run into
trouble.
 
The cause of the trouble seems to be either the remote HTTPS server or my
local proxy server (do not know which) dropping the tunneling connection
that httpclient creates during the first request. The results of which seem
to
vary: sometimes HttpClient.executeMethod() throws a HttpRecoverableException

to me, sometimes a java.net.SocketException is thrown somewhere down in the
call (HttpMethodBase.writeRequestHeaders there somewhere along the line)
and HttpClient tries a retry on its own. I get around the first case by just
creating
a new PostMethod instance and retrying the very same request with it, works
fine, but I'm stuck right now with the second case. It seem HttpClient won't
try tunneling another time but just sends a 
"POST https://remote.host.com/foo/bar <https://remote.host.com/foo/bar>
HTTP/1.1" request to I do not know
whom (my proxy or the remote server?), gets a "HTTP/1.0 200 OK" response
and then nothing more.
 
I do not know if the problem is with HttpClient or with either uncompliant
proxy
or remote server.
 
Is there any way to turn any tunneling off altogether to see if the first
request would succeed in non-tunneling proxy mode? (I do not know the
details of the HTTPS proxying protocol, but I suppose the tunneling is
optional?!)
 
Any other ideas/hints about this?
 
All help is highly appreciated.
 
Best regards,
 
Jani Mattsson