You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Steve Labarbera <st...@whitehatsec.com> on 2011/07/02 19:35:42 UTC

Where can I find were HttpClient handles the CONNECT tunneling through SSL

I was using HTTPOClient for a while to handle all my HTTP request /responses. However, I have recently needed to build my own client due to my need to send requests that did not correctly URLEncode specified by RFC Standards. I'm creating a proxy and need to be able to handle when the client "The browser" sends a CONNECT request. I was hoping to be able to look at how HHTPClient does it to maybe help me figure it out. Does anyone know where exactly that section of code lives? I looked httpclient\src\main\resources\java\org\apache\http\conn\ssl but could not see anything?

I'm having a very very hard time trying to handle this CONNECT request and have looked all over the internet. This i'm hoping will be able to enlighten me as to how its handled.

Regards,

Steve
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Where can I find were HttpClient handles the CONNECT tunneling through SSL

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sat, 2011-07-02 at 17:35 +0000, Steve Labarbera wrote:
> I was using HTTPOClient for a while to handle all my HTTP request /responses. However, I have recently needed to build my own client due to my need to send requests that did not correctly URLEncode specified by RFC Standards. I'm creating a proxy and need to be able to handle when the client "The browser" sends a CONNECT request. I was hoping to be able to look at how HHTPClient does it to maybe help me figure it out. Does anyone know where exactly that section of code lives? I looked httpclient\src\main\resources\java\org\apache\http\conn\ssl but could not see anything?
> 
> I'm having a very very hard time trying to handle this CONNECT request and have looked all over the internet. This i'm hoping will be able to enlighten me as to how its handled.
> 
> Regards,
> 
> Steve

Hi Steve

Take a look at the DefaultRequestDirector [1] and #createTunnelToTarget
method in particular for a blocking (synchronous) implementation and at
the DefaultAsyncRequestDirector [2] for a non-blocking (asynchronous)
one.

Hope this helps

Oleg

PS: by the way, building an HTTP client from scratch is not an easy
task. You might be better off reusing HttpCore (or a similar HTTP
transport toolkit) for low level stuff. 

[1]
http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
[2]
http://svn.apache.org/repos/asf/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultAsyncRequestDirector.java



> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org