-
Notifications
You must be signed in to change notification settings - Fork 75
Is the HTTPS proxy support known-working under real-world conditions? #212
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
Comments
Proof-of-concept that shows the endpoint SSL does need to happen against the proxy_sock:
This is obviously not a suitable solution for this library. Unfortunately I rarely need to work with this low level of IO so I'm not sure the best way to solve the |
Just to close the loop for anyone else looking for this, the fix is being worked on here: |
Uh oh!
There was an error while loading. Please reload this page.
I've been debugging HTTPS proxy support all day and I'm coming to the conclusion the released implementation may be be broken.
Stepping through an example invocation:
connect
is invokedI don't believe the last step works.
To test I banged out a little helper class that does the initial proxy connection setup:
Then, as a baseline, I checked that basic HTTP proxying was working:
This returns the expected
HTTP/1.1 301 Moved Permanently Location: http://www.google.com/
response.Then, I tried the flow Net::HTTP currently does:
This throws the following error, which is the same error I get from Net::HTTP:
As a second test I tried performing another HTTP proxy test, this time using CONNECT:
This outputs two blocks. The first block uses the SSL socket and returns
HTTP/1.1 301 Moved Permanently
, as expected. The second block attempts to use the underlying TCP socket, same as we're trying to do for the endpoint SSL socket, and that returns�*o�Ń7�t��4��w4Q���k�9o�
which appears to be encrypted data.When using a HTTPS proxy the socket s IO will be encrypted, I don't believe this is the correct handle to use for the endpoint encryption.. I believe we need to initialize the endpoint ssl over the proxy_sock to nest the encryption.
To this end, I tried
endpoint_sock = OpenSSL::SSL::SSLSocket.new(ps.proxy_sock)
but that simply throwswrong argument type OpenSSL::SSL::SSLSocket (expected File) (TypeError)
. So I don't have a working HTTPS over HTTPS proxy example on hand.I'm currently of the opinion the implementation here is broken. Am I mistaken? Is there a flaw in my analysis and test cases?
The text was updated successfully, but these errors were encountered: