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

override tscert.TailscaledTransport with muxing transport #67

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

willnorris
Copy link
Member

@willnorris willnorris commented Jun 7, 2024

This provides an http.RoundTripper implementation that dynamically routes requests to the correct tsnet server's LocalAPI based on the ClientHelloInfo in the context.

Previously, we were just overriding the tscert Dialer. That worked fine the first time it dialed a LocalAPI, and would correctly dial the right tsnet server. However, tscert caches the Transport with that Dialer, so requests that should be routed to different tsnet servers would be routed incorrectly.

Updates #19
Updates #53
Updates #66

DO NOT MERGE: this relies on tailscale/tscert#11

This provides an http.RoundTripper implementation that dynamically
routes requests to the correct tsnet server's LocalAPI based on the
ClientHelloInfo in the context.

Previously, we were just overriding the tscert Dialer. That worked fine
the first time it dialed a LocalAPI, and would correctly dial the right
tsnet server. However, tscert caches the Transport with that Dialer, so
requests that should be routed to different tsnet servers would be
routed incorrectly.

Updates #19
Updates #53
Updates #66

Signed-off-by: Will Norris <[email protected]>
@willnorris willnorris requested a review from irbekrm June 8, 2024 15:36
@willnorris willnorris marked this pull request as ready for review June 8, 2024 15:37
Copy link
Contributor

@irbekrm irbekrm left a comment

Choose a reason for hiding this comment

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

Really cool debugging on #66 !

I've read the code + was able to reproduce the issue and verify the fix with changes from this PR.

@willnorris willnorris merged commit 4e8fde6 into main Jun 18, 2024
3 checks passed
@willnorris willnorris deleted the will/transport branch June 18, 2024 04:12
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.

2 participants