fix: Add tls-server-name support for Teleport proxy compatibility#500
fix: Add tls-server-name support for Teleport proxy compatibility#500
Conversation
Fixes #495 This adds support for the `tls-server-name` field in kubeconfig clusters, which is required for Teleport Kubernetes proxy and similar setups where the TLS SNI must differ from the server hostname. The fix follows the same pattern already used for `proxy-url` support.
WalkthroughAdds TLS Server Name (SNI) support to Kubernetes configuration handling by reading the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (3)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes #495
This PR adds support for the
tls-server-namefield in kubeconfig cluster configurations, enabling KRR to work with Teleport Kubernetes proxy and similar setups where the TLS SNI (Server Name Indication) must differ from the server hostname.Problem
When using Teleport as a Kubernetes proxy, the kubeconfig contains:
KRR was failing with SSL certificate verification errors because it wasn't respecting the
tls-server-namefield. The CA certificate is valid for the SNI name, not the server hostname.Solution
Extended the existing
config_patch.pypattern (already used forproxy-url) to also handletls-server-name:tls-server-namefrom the cluster config in_load_cluster_info()Configurationobject via_set_config()tls_server_nameattribute to theConfigurationclassThis follows the exact same approach already proven to work for the
proxy-urlfield.Testing
cc @prein - Would you be able to test this fix with your Teleport setup?