Skip to content
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

Fix HTTP client proxy support #742

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DerGuteMoritz
Copy link
Collaborator

Fixes #731

Since the introduction of HTTP/2 support in the client, proxy handlers (requested via proxy-options)
would be installed only after the HTTP version was negotiated. In case of a HTTPS connection, this
would be attempted via ALPN which means the TLS handshake would have already taken place with the
actual destination host, bypassing the configured proxy. This resulted in an error (see #731).

With this patch, the proxy handlers are installed earlier again so that a configured proxy is also
used during the TLS handshake phase.
Turns out this worked perfectly fine already.
@DerGuteMoritz
Copy link
Collaborator Author

FYI: There's a huge diff there due to wrapping + reindent, so I recommend to hide whitespace when looking at the diff once more!

@@ -396,7 +396,7 @@

:else
cause)]
(s/put! response-stream response)
(d/error! early-response-d response)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, so far, I was unable to even reach this code path and have it result in an error response anyway. It would probably be a good idea to come up with a bunch of test cases for the proxy functionality (currently there are none).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given how untested proxy code is, I'd strongly suggest writing tests before approving.

Maybe whoever needed the proxies could lend a hand?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to come up with a test that fails as expected without the patch - sanity check welcome 🙏

Using the test as a basis, I should be able to see how we can reach the error case referenced above. Stay tuned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proxy functionality broken in Aleph 0.7.0 and later
2 participants