-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document org.eclipse.jetty.client.Socks4Proxy "secure" parameter #7647
Comments
This setting is for the initial tunnel established between the client and the socks4 proxy server, before the request is sent.
If you have a tunnel that's unencrypted between the client and the socks4 proxy server, but a request that's https, then the initial connection between the client and the socks4 proxy server will show the proxy protocol to establish the connection in a non-encrypted way, but the rest of the conversation is encrypted (the client negotiates the TLS connection between itself and the destination server. the socks4 proxy server is just forwarding bytes back and forth) That help? |
The most common setup we encounter is |
@joakime If I understood you correctly, given:
When Is that correct? |
@cowwoc not sure I understand. You start with an HttpClient that wants to talk to a destination making a request for a specific resource, using HTTP. Lets say you have ...
This now becomes ...
Not sure how this fits in your scenario. |
@joakime I think we're on the same page. My understanding is that if Meaning, if I issue an HTTPS request to eclipse.org through proxy.machine.com then:
Is that correct? My understanding is that the proxy acts as a man-in-the-middle. Are you saying otherwise? Will HttpClient somehow communicate with eclipse.org over an encrypted tunnel even if |
Incorrect, there's no HTTP request here.
This "connect" is just a simple tcp connect from proxy.machine.com to eclipse.org:9999, nothing else, no TLS, no data is sent to eclipse.org:9999.
Also incorrect, the proxy.machine.com doesn't issue HTTP or HTTPS.
Nope, the entire encrypted conversation is between HttpClient and eclipse.org, proxy.machine.com is not involved there, it's merely passing bytes back and forth. It was never involved in the TLS negotiation or the HTTP exchange.
proxy.machine.com does not encrypt/decrypt between itself and eclipse.org. |
Here's the basics of SOCKS ... If we put HTTP into this mix, we get ... If we encrypt both connections we get this ...
To conclude, the Socks4Proxy "secure" setting is about the connection between the Client and the Socks Proxy, it has no relationship or behavior with any connection to the target server. You could even have a setup where the connection between the Client and Socks Proxy is encrypted, but the traffic from the Socks Proxy to the Target Server is NOT encrypted. (that's a perfectly valid and common scenario) |
Thank you. So if I understand correctly, I'm still a bit confused about the socks handshake though. In the following scenario, who is the "client", "socks server" and "target server"?
It sounds as if the machine I am SSHing into plays the role of both the "socks server" and "target server". Any website I hit through the proxy doesn't seem to be aware that some 3rd party is directing the calls behind the proxy. Am I wrong? |
This issue has been automatically marked as stale because it has been a |
This issue has been automatically marked as stale because it has been a |
Sorry for the late reply.
Correct. If
"Client" is the browser. When you use the browser for Then the SOCKS proxy will establish a connection to If you are using I'll update the javadocs of the relevant classes. |
…parameter Added javadocs and documentation. Signed-off-by: Simone Bordet <[email protected]>
Target Jetty version(s)
11.0.8
Enhancement Description
Socks4Proxy has a constructor that takes a
boolean secure
argument. I'd love to understand the implication oftrue
andfalse
values for this parameter. All I know is that when I setsecure=true
I am no longer able to tunnel through a SOCKS proxy :)First, I'd like to understand what's insecure about
secure=false
. Secondly, I'd like to understand whysecure=true
is failing for me.What I'm doing:
I used Apache Mina to create a SOCKS proxy over SSH tunnel. I can connect
Socks4Proxy(secure=false)
to it, butsecure=true
fails. If I understood the meaning of this parameter then maybe I could circle back to the MINA guys and ask them what it would take to makesecure=true
work.The text was updated successfully, but these errors were encountered: