The Python Oracle

AttributeError: '_socketobject' object has no attribute 'set_tlsext_host_name'

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Melt

--

Chapters
00:00 Question
01:20 Accepted answer (Score 14)
01:34 Answer 2 (Score 3)
01:53 Answer 3 (Score 2)
02:06 Thank you

--

Full question
https://stackoverflow.com/questions/3157...

Question links:
https://urllib3.readthedocs.org/en/lates...
[InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately]: https://stackoverflow.com/questions/2913...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #ubuntu #ssl #https #pythonrequests

#avk47



ACCEPTED ANSWER

Score 14


The fix for me was the following:

sudo apt-get purge python-openssl
sudo pip install pyopenssl



ANSWER 2

Score 3


This was able to get the python working on Ubuntu 12.04.3 LTS for me.

sudo apt-get install python-dev python-pip build-essential libffi-dev
sudo -H pip install --upgrade pip setuptools && sudo -H pip install --upgrade pyopenssl



ANSWER 3

Score 2


On RedHat:

sudo yum remove pyOpenSSL
sudo pip install pyopenssl