Use the proxy transport for tsh proxy ssh#34396
Merged
espadolini merged 4 commits intomasterfrom Dec 7, 2023
Merged
Conversation
b8eeec1 to
1c5d3c8
Compare
9911e8b to
e519728
Compare
749a4d9 to
4943885
Compare
rosstimothy
approved these changes
Nov 21, 2023
Joerger
reviewed
Nov 27, 2023
Contributor
Joerger
left a comment
There was a problem hiding this comment.
LGTM. Only issue I found is that running tsh proxy ssh directly, ctrl+C does not exit, though the ssh connection does still close.
rosstimothy
reviewed
Nov 28, 2023
Comment on lines
+77
to
+94
| errC := make(chan error, 2) | ||
| go func() { | ||
| _, err := io.Copy(os.Stdout, conn) | ||
| if err != nil && utils.IsOKNetworkError(err) { | ||
| err = nil | ||
| } | ||
| errC <- err | ||
| }() | ||
| go func() { | ||
| _, err := io.Copy(conn, os.Stdin) | ||
| if err != nil && utils.IsOKNetworkError(err) { | ||
| err = nil | ||
| } | ||
| errC <- err | ||
| }() | ||
|
|
||
| return &sshProxyParams{ | ||
| proxyHost: sshProxyHost, | ||
| proxyPort: sshProxyPort, | ||
| clusterName: ping.ClusterName, | ||
| tlsRouting: ping.Proxy.TLSRoutingEnabled, | ||
| }, nil | ||
| return trace.NewAggregate(<-errC, <-errC) | ||
| })) |
Contributor
There was a problem hiding this comment.
Can we use utils.ProxyConn here? That has support for terminating on context cancellation which I think would prevent the CTRL+C issue mentioned by @Joerger.
Contributor
Author
There was a problem hiding this comment.
(and yes, it does indeed close on ^C now)
rosstimothy
approved these changes
Dec 6, 2023
Joerger
approved these changes
Dec 7, 2023
|
@espadolini See the table below for backport results.
|
espadolini
added a commit
that referenced
this pull request
Dec 7, 2023
* Use the proxy transport for tsh proxy ssh * Exit cleanly from TransportService/ProxySSH * Use utils.ProxyConn
espadolini
added a commit
that referenced
this pull request
Feb 2, 2024
* Use the proxy transport for tsh proxy ssh * Exit cleanly from TransportService/ProxySSH * Use utils.ProxyConn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes the transport used by
tsh proxy sshfrom the "proxySubsys" mechanism that uses the Teleport Proxy SSH listener to the gRPCteleport.transport.v1.TransportService/ProxySSHendpoint that's already exclusively used bytsh sshsince Teleport v14.