-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 tunnel address for TLS routing if public tunnel address is present #8961
Fix tunnel address for TLS routing if public tunnel address is present #8961
Conversation
474e5de
to
48c1b9a
Compare
48c1b9a
to
1758f14
Compare
api/client/webclient/webclient.go
Outdated
|
||
// Got proxy address without a port like: proxy.example.com | ||
// If proxyAddr doesn't contain any port it means that HTTPS port should be used. | ||
return net.JoinHostPort(host, "443"), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 443? Isn't default proxy port 3080?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is invoked only if Find web
API call succeed.
if proxyAddr
format doesn't contain port number it means that the default https
port was used in Find API call:
endpoint := fmt.Sprintf("https://%s/webapi/find", proxyAddr)
req, err := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil)
https://github.com/gravitational/teleport/blob/master/api/client/webclient/webclient.go#L95
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I see. This is a little confusing, let's at least expand the comment to explain. Also, do we have a constant for 443?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extended the comment.
Also, do we have a constant for 443?
there is gravitational/teleport.StandardHTTPSPort const but importinggravitational/teleport
in teleport/api` pkg is not possible thus I move this const to api defaults.
api/client/webclient/webclient.go
Outdated
|
||
// Got proxy address without a port like: proxy.example.com | ||
// If proxyAddr doesn't contain any port it means that HTTPS port should be used. | ||
return net.JoinHostPort(host, "443"), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I see. This is a little confusing, let's at least expand the comment to explain. Also, do we have a constant for 443?
2f83086
to
ac3ec8a
Compare
ac3ec8a
to
cb73e58
Compare
Issue: #8952
What
Fix destination reverse tunnel address in case if proxy support TLS Routing.
This PR change the
tunnelAddr
logic and onlypublic_proxy_addr
andwebProxy
addresses are used as tunnel address if proxy support TLS Routing.