From e7586153bedff3f8f2853494c1a04fd9c7623265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20=22Pisco=22=20Fernandes?= Date: Mon, 17 Mar 2025 18:42:19 +0000 Subject: [PATCH] TUN-9101: Don't ignore errors on `cloudflared access ssh` ## Summary This change ensures that errors resulting from the `cloudflared access ssh` call are no longer ignored. By returning the error from `carrier.StartClient` to the upstream, we ensure that these errors are properly logged on stdout, providing better visibility and debugging capabilities. Relates to TUN-9101 --- cmd/cloudflared/access/carrier.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/cloudflared/access/carrier.go b/cmd/cloudflared/access/carrier.go index 12cc8ac7..11190de7 100644 --- a/cmd/cloudflared/access/carrier.go +++ b/cmd/cloudflared/access/carrier.go @@ -104,7 +104,7 @@ func ssh(c *cli.Context) error { case 3: options.OriginURL = fmt.Sprintf("https://%s:%s", parts[2], parts[1]) options.TLSClientConfig = &tls.Config{ - InsecureSkipVerify: true, + InsecureSkipVerify: true, // #nosec G402 ServerName: parts[0], } log.Warn().Msgf("Using insecure SSL connection because SNI overridden to %s", parts[0]) @@ -141,6 +141,5 @@ func ssh(c *cli.Context) error { logger := log.With().Str("host", url.Host).Logger() s = stream.NewDebugStream(s, &logger, maxMessages) } - carrier.StartClient(wsConn, s, options) - return nil + return carrier.StartClient(wsConn, s, options) }