Add debug logging to tsh when there is a SAN mismatch connecting to Auth via Proxy#61059
Add debug logging to tsh when there is a SAN mismatch connecting to Auth via Proxy#61059
tsh when there is a SAN mismatch connecting to Auth via Proxy#61059Conversation
fead035 to
a44b627
Compare
Signed-off-by: Chris Thach <chris.thach@goteleport.com>
a44b627 to
62c3257
Compare
tsh login when there is a DNS SAN mismatchtsh login when there is a DNS SAN mismatch
Signed-off-by: Chris Thach <chris.thach@goteleport.com>
…tional/teleport into cthach/improve-tsh-login-logging
tsh login when there is a DNS SAN mismatchtsh login when there is a DNS SAN mismatch
Signed-off-by: Chris Thach <chris.thach@goteleport.com>
Signed-off-by: Chris Thach <chris.thach@goteleport.com>
tsh login when there is a DNS SAN mismatchtsh login when there is a DNS SAN mismatch
That's better but I think it still might be confusing to people because the address they are connecting to might not be one that they are familiar with. When we dial auth we dial In that case I think it would be better if we can explicitly have a message indicating that we were unable to connect to Auth via the Proxy. |
Ohhhh that makes sense. I'll push an update. |
…onnecting to Auth. Signed-off-by: Chris Thach <chris.thach@goteleport.com>
tsh login when there is a DNS SAN mismatchtsh login when there is a SAN mismatch connecting to Auth via Proxy
tsh login when there is a SAN mismatch connecting to Auth via Proxytsh when there is a SAN mismatch connecting to Auth via Proxy
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
Signed-off-by: Chris Thach <chris.thach@goteleport.com>
| } | ||
| } | ||
|
|
||
| return fmt.Sprintf(`Cannot connect to the Auth service via the Teleport Proxy using the internal cluster domain %q. |
There was a problem hiding this comment.
What do you think about removing the internal domain reference from this message? This is more of an internal thing that might be better suited for the debug info below.
There was a problem hiding this comment.
| return fmt.Sprintf(`Cannot connect to the Auth service via the Teleport Proxy using the internal cluster domain %q. | |
| return fmt.Sprintf(`Cannot connect to the Auth service via the Teleport Proxy. |
Yeah, good point. It's not really useful or actionable to an end user AFAIK, so I'm fine with removing it and moving it to the debug info.
Side note: I'm not totally familiar with how and why that internal cluster domain resolves to Auth. If you have any reading material, please send it my way if you get a chance.
Signed-off-by: Chris Thach <chris.thach@goteleport.com>
Signed-off-by: Chris Thach <chris.thach@goteleport.com>
juliaogris
left a comment
There was a problem hiding this comment.
Updated. Please see PR description and let me know if it's more readable now 🙏🏾
Looks great to me.
Closes #60676
Changelog: Improve error message of
tshwhen there is a certificate DNS SAN mismatch when connecting to Auth via Proxy.Demo
Before
After
$ build/tsh login --proxy=somenumber.teleport.cluster.local:443 ERROR: Cannot connect to the Auth service via the Teleport Proxy. There might be one or more network intermediaries (like a proxy or VPN) that are modifying your connection before it reaches the Teleport Proxy. These intermediaries can alter how your connection is seen by the Teleport Proxy and routed, leading to certificate mismatches. To fix this, ensure that any network intermediaries are properly configured and not interfering with your connection. DEBUG INFO: Host: somenumber.teleport.cluster.local Proxy Environment Variables: http_proxy: bad.proxy.example Server Certificate Details: Subject: OU=christhach@Chriss-MBP.local (Chris Thach),O=mkcert development certificate Issuer: CN=mkcert christhach@Chriss-MBP.local (Chris Thach),OU=christhach@Chriss-MBP.local (Chris Thach),O=mkcert development CA Serial Number: 12507712134221951695701778001476744009 Not Before: 2025-08-14 17:37:06 +0000 UTC Not After: 2027-11-14 18:37:06 +0000 UTC DNS Names: [teleport.dev *.teleport.dev] IP Addresses: []