-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
SSL verification on python2.7 failing #36
Comments
it does work with python3.5 |
are you using latest urllib3? can you run setup.py install and try this again or try to manually update urllib3. pip show urllib3
Name: urllib3
Version: 1.19.1
Summary: HTTP library with thread-safe connection pooling, file post, and more. Also what is your python version? $ python --version
Python 2.7.12 |
I figured this out. We had a patch that we removed because urllib3 is already doing the patch, however it only does that if package "ipaddress" is installed. I added that as a dependency so we should be good. |
More concrete reason here: https://github.com/shazow/urllib3/blob/master/urllib3/packages/ssl_match_hostname/_implementation.py#L9 |
ok confirmed that it solved the issue. |
Still not working for python 2.x windows 10 |
Hey
Thanks
On Sun, May 28, 2017 at 9:10 AM Mehdy Bohlool ***@***.***> wrote:
https://github.com/kubernetes-incubator/client-python/blob/master/README.md#hostname-doesnt-match
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#36 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQel4SxEv6OCtfDYGMCYATi7E3UscAISks5r-ZxYgaJpZM4K6ZZl>
.
--
Madhav Malhotra
Graduate Student
University of Victoria
Canada +1-778-922-5630
|
Hi,
I have following versions of packages python --version pip show ipaddress pip show urllib3 Any ideas please? |
What is your |
Same problem here:
The actual error looks a little different, though the underlying problem seems exactly the same
Additionally, |
You are calling exec. We use websocket library for exec. They introduced some bug and we limited the version in the dependency file (requirements.txt). If you search issues for websocket or just make sure you are using compatible websocket version, that should fix your problem. |
Thanks for the info! I have noticed that.
The error I posted previously I got using from kubernetes.client import configuration
configuration.assert_hostname = True After doing that I was able to move forward a bit, but not without another failure. Here's my full code: from kubernetes.client import configuration
from kubernetes import config
from kubernetes.client.apis import core_v1_api
configuration.assert_hostname = False
config.load_kube_config()
c = core_v1_api.CoreV1Api()
c.connect_get_namespaced_pod_exec("mypod", "namespace", command="/bin/bash -c 'ls'")
# stacktrace...
# ApiException: (0)
# Reason: Handshake status 404 I feel like I'm missing something, appreciate the help! |
BTW I have looked at #144 and updated my snippet (as seen above), and I get the exact same issue there... I have tested on my local machine (OS X, Have also done some debugging and the final url used in the websocket call is |
Interesting. Try kubectl (to call exec on your pod) with |
My cluster is on GKE, master version is
(I've omited query strings on both urls) |
We had a bug in gke config loader. Can you try latest beta release 3.0.0b1
to see if that fixes your problem?
…On Jul 31, 2017 7:17 AM, "Flavia Missi" ***@***.***> wrote:
My cluster is on GKE, master version is 1.5.7, node version 1.4.7.
$ kubectl exec mypod ls -v 9
[...]https://same.master.ip/api/v1/namespaces/default/pods/mypod/exec
(I've omited query strings on both urls)
So exactly same url, only different protocols.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#36 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABic4HKzsku-uV9MFXEitOk6h2xPK2mAks5sTeIMgaJpZM4K6ZZl>
.
|
Tried updating it, didn't work... But I found the issue somewhere else, the problem is on query_params = [(key, value) for key, value in query_params if
key != 'command']
I do believe this is a bug on your side though, since only |
Nice that you figured it out. Both/either issue and PR are welcome. |
Hi - I have hit the same issue with the following log Following are my configurations urllib3 Metadata-Version: 1.1 python version K8 cluster Is the above version of urllib3 supported? UPDATE:
But looking for solutions with Python 2.7 |
from kubernetes.client import configuration this works fine for me |
from kubernetes import client
from kubernetes import config
from kubernetes.client.api import core_v1_api
config.load_kube_config('/root/.kube/config')
configuration = client.Configuration()
configuration.assert_hostname = False
configuration.verify_ssl = True
client.Configuration.set_default(configuration)
v1 = core_v1_api.CoreV1Api()
print("Listing pods with their IPs:")
ret = v1.list_pod_for_all_namespaces(watch=False)
for i in ret.items:
print("%s\t%s\t%s" % (i.status.pod_ip, i.metadata.namespace, i.metadata.name)) this works for me |
Keep the watch action working forever
I saw a commit flying by that said this was fixed but I get:
The text was updated successfully, but these errors were encountered: