From 15438674f060be183a86c45f500f68674d94d620 Mon Sep 17 00:00:00 2001 From: Noah Stride Date: Mon, 4 Nov 2024 18:17:12 +0000 Subject: [PATCH] Convert final callsite --- lib/tbot/service_identity_output.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/tbot/service_identity_output.go b/lib/tbot/service_identity_output.go index ce74a90dddea1..148688022f0ef 100644 --- a/lib/tbot/service_identity_output.go +++ b/lib/tbot/service_identity_output.go @@ -28,7 +28,6 @@ import ( "github.com/gravitational/trace" "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/client/webclient" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth/authclient" "github.com/gravitational/teleport/lib/config/openssh" @@ -239,7 +238,7 @@ type alpnTester interface { func renderSSHConfig( ctx context.Context, log *slog.Logger, - proxyPing *webclient.PingResponse, + proxyPing *proxyPingResponse, clusterNames []string, dest bot.Destination, certAuthGetter certAuthGetter, @@ -255,7 +254,11 @@ func renderSSHConfig( proxyAddr := proxyPing.Proxy.SSH.PublicAddr if proxyPing.Proxy.TLSRoutingEnabled { - + var err error + proxyAddr, err = proxyPing.tlsRoutingProxyPublicAddr() + if err != nil { + return trace.Wrap(err, "determining tls routing address") + } } proxyHost, proxyPort, err := utils.SplitHostPort(proxyAddr) @@ -315,7 +318,7 @@ func renderSSHConfig( connUpgradeRequired := false if proxyPing.Proxy.TLSRoutingEnabled { connUpgradeRequired, err = alpnTester.isUpgradeRequired( - ctx, proxyPing.Proxy.SSH.PublicAddr, botCfg.Insecure, + ctx, proxyAddr, botCfg.Insecure, ) if err != nil { return trace.Wrap(err, "determining if ALPN upgrade is required")