-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client doesn't honor tls-server-name setting in kubeconfig #1889
Comments
/assign |
do you mind to send a PR? Thanks. |
Unfortunately, there are lots of hoops to jump through (CLA, tests, company OSS policy that's non-existent, etc) and I am not really a pythonista. This is why I pointed to what I think are the right spots in code base. Also, it seems the client/rest.py is part of the generated code, so not entirely sure how that should be patched (hopefully not yet another rest_client_patch.diff) and I am not really inclined to chase down how to do it correctly. Best of luck in getting this fixed. |
Adding a +1. I'm using a kubeconfig with a tls-server-name that's different from the cluster hostname. I wound up hacking this in a fork bc I also don't know what the process is to get the OpenAPI schema updated and clients regenerated. This is the crux of the fix, but obviously it needs to plumbed through the configuration object. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten |
What happened (please include outputs or screenshots):
Tried to connect to my cluster with a utility that uses your library. As far as I can tell, the utility's code is correct and the k8s-client python code does not honor the tls-server-name and propagate it down the stack to urllib3.
Received this exception:
This is explicitly why I set tls-server-name in my kubeconfig.
What you expected to happen:
TLS connection to my cluster, with the proper SNI sent.
How to reproduce it (as minimally and precisely as possible):
Set your cluster.server property to some IP/CNAME not in the cert. Set tls-server-name in kubeconfig correctly.
Anything else we need to know?:
Looks like it is pretty easy to support. Just need to change https://github.com/kubernetes-client/python/blob/master/kubernetes/base/config/kube_config.py#L544 to read the tls-server-name, and make sure that gets propagated to https://github.com/kubernetes-client/python/blob/master/kubernetes/client/rest.py#L73 as
assert_hostname
The text was updated successfully, but these errors were encountered: