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

Ignore HTTP_PROXY in reverse tunnels, part 2 #12335

Merged
merged 9 commits into from
May 11, 2022

Conversation

atburke
Copy link
Contributor

@atburke atburke commented Apr 29, 2022

This PR disables HTTP_PROXY in a few places that were missed in #11990.

Copy link
Collaborator

@r0mant r0mant left a comment

Choose a reason for hiding this comment

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

Let's please also add test coverage to make sure it does not regress again.

lib/auth/clt.go Outdated Show resolved Hide resolved
lib/reversetunnel/resolver.go Show resolved Hide resolved
@atburke atburke requested a review from r0mant May 4, 2022 21:55
@atburke
Copy link
Contributor Author

atburke commented May 5, 2022

@r0mant Can you take another look at this?

Copy link
Collaborator

@r0mant r0mant left a comment

Choose a reason for hiding this comment

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

@atburke The code lgtm in general but I'm having a bit of a hard time understanding in which cases we'll be respecting vs not respecting proxies with these changes. Mostly because these clients are used throughout the code.

Before we merge this, could you please help me clarify my understanding regarding the following:

  • In which scenarios the proxy will be respected? When using tsh only?
  • In which scenarios the proxy will not be respected? For inter-process communication?
  • In which scenarios the proxy was respected prior to your original HTTP_PROXY changes? Never?

@@ -55,6 +55,8 @@ func Connect(ctx context.Context, cfg *Config) (auth.ClientI, error) {
Credentials: []apiclient.Credentials{
apiclient.LoadTLS(cfg.TLS),
},
// Deliberately ignore HTTP proxies for backwards compatibility.
IgnoreHTTPProxy: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm probably missing something, but I'm still not sure why we need to ignore it in the authclient too. Isn't lib/reversetunnel/resolver enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It isn't enough. authclient was also affected by the original HTTP_PROXY change. TestMultiPortNoProxy doesn't pass unless authclient ignores proxies.

@atburke
Copy link
Contributor Author

atburke commented May 6, 2022

Previously, HTTP_PROXY was only supported (as far as I can tell) for inter-process communication in single-port mode. My original HTTP_PROXY PR added support deliberately for tsh and accidentally for IPC in multi-port mode. This PR removes support for IPC in multi-port mode. The end result should be that HTTP_PROXY is supported for tsh and ALPN mode, and not in single-port mode.

Copy link
Contributor

@nklaassen nklaassen left a comment

Choose a reason for hiding this comment

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

Looks alright to me.

Do we have any docs on when exactly this env variable applies? I'm somewhat confused, I imagine it could be pretty confusing for users

@atburke
Copy link
Contributor Author

atburke commented May 11, 2022

We have a docs page for http proxy. I'll update it with the current behavior in a new PR.

@atburke atburke enabled auto-merge (squash) May 11, 2022 22:39
@atburke atburke merged commit e1e6437 into master May 11, 2022
@atburke atburke deleted the atburke/reversetunnel-no-proxy-2 branch May 11, 2022 23:09
atburke added a commit that referenced this pull request May 11, 2022
This change disables HTTP_PROXY in a few places that were missed in #11990.
atburke added a commit that referenced this pull request May 11, 2022
This change disables HTTP_PROXY in a few places that were missed in #11990.
atburke added a commit that referenced this pull request May 12, 2022
This change disables HTTP_PROXY in a few places that were missed in #11990.
atburke added a commit that referenced this pull request May 12, 2022
This change disables HTTP_PROXY in a few places that were missed in #11990.
atburke added a commit that referenced this pull request May 31, 2022
atburke added a commit that referenced this pull request Jun 7, 2022
This change undoes the changes in #11990 and #12335 for Teleport going forward.
@webvictim webvictim mentioned this pull request Jun 8, 2022
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.

4 participants