Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP SSL Proxy with Java Apache HttpClient

Is it possible to use an SSL Proxy with Java HttpClient (or any other client if not) ?

My real problem is to have a direct SSL proxy to send HTTP or HTTPS connections and to check the SSL proxy and Client certificates.

For example, for an HTTP request (we check SSL proxy certificate on client, and client certificate on proxy):

CLIENT --- SSL socket (HTTPS) ---> SSL PROXY --- Plain socket (HTTP) ---> SERVER

And for HTTPS request (use CONNECT request to tunnel SSL connection) (we check SSL proxy certificate and Server certificate on client, and client certificate on proxy and possibly on server if requested):

CLIENT --- SSL socket (HTTPS tunnel) ---> SSL PROXY --- SSL socket (HTTPS) ---> SERVER

I can't find a way to do that with HttpClient which only allows to set a plain HTTP Proxy that can tunnel HTTPS request (but that is not what I want)

Thanks

like image 364
Jean-Baptiste Reich Avatar asked Dec 15 '25 15:12

Jean-Baptiste Reich


1 Answers

I was able to make the Apache HttpClient connect to an SSL enabled proxy. Check this SO post for the code : HttpRouteP​lanner - How does it work with an HTTPS Proxy

like image 125
MediumOne Avatar answered Dec 17 '25 21:12

MediumOne



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!