Python: SSL Error

Created on 7 Mar 2017  路  6Comments  路  Source: kubernetes-client/python

I have installed kubectl and minikube and able to run them directly on console

But running this

ret = v1.list_pod_for_all_namespaces(watch=False)

ApiException: (0)
Reason: SSLError
[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645)

gives an SSL error

Most helpful comment

Yes thats exactly correct.

All 6 comments

Can you also give your setup detail? If I have to guess, I say you are on mac and your OPENSSL_VERSION is less than 1.0.0. Run this command:

python -c "import ssl; print ssl.OPENSSL_VERSION"

Yes thats exactly correct.

I am having the same problems, I ran that command that python command and got openSSL 1.0.2k 26 Jan 2017. does it need to be a specific version? I am on a OSX system

No, it should work. Can you share your code snippet and the exact error? Also did you try kubectl to make sure the same command works there?

I also have the same problem. And solve by reinstall openssl and python.

 brew update
 brew install openssl
 brew install python

then use new python in virtualenv

virtualenv -p /usr/local/Cellar/python/2.7.13/bin/python ~/.venv

This is due to the recent TLS support deprecation by Python.org sites. Just install pip using curl (See this post: https://stackoverflow.com/a/49769015/1526703)

Was this page helpful?
0 / 5 - 0 ratings