Skip to content Skip to sidebar Skip to footer

Attributeerror: '_socketobject' Object Has No Attribute 'set_tlsext_host_name'

In python, on a Ubuntu server, I am trying to get the requests library to make https requests, like so: import requests requests.post('https://example.com') At first, I got the fo

Solution 1:

The fix for me was the following:

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

Solution 2:

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

Solution 3:

On RedHat:

sudo yum remove pyOpenSSL
sudo pip install pyopenssl

Post a Comment for "Attributeerror: '_socketobject' Object Has No Attribute 'set_tlsext_host_name'"