in Python, su un server di Ubuntu, sto cercando di ottenere la libreria requests
per fare richieste https, in questo modo:AttributeError: oggetto '_socketobject' non ha alcun attributo 'set_tlsext_host_name'
import requests
requests.post("https://example.com")
In un primo momento, ho ha ottenuto la seguente:
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning .
Dopo aver seguito i consigli contenuti in questa domanda: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately, ora ho aggiornato il mio avvertimento per il seguente errore:
AttributeError: '_socketobject' object has no attribute 'set_tlsext_host_name'
Come posso risolvere questo problema?
avevo bisogno di 'sudo apt-get install libffi-dev' prima di installare pyOpenSSL – laffuste