In Python, auf einem Ubuntu-Server, Ich versuche, die requests
Bibliothek zu bekommen, um HTTPS-Anfragen zu machen, etwa so:Attribute: '_socketobject' Objekt hat kein Attribut 'set_tlsext_host_name'
import requests
requests.post("https://example.com")
Zuerst habe ich bekam die folgenden:
/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 .
nach dem Rat in dieser Frage folgenden: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately, ich habe jetzt meine Warnung an den folgenden Fehler aktualisiert:
AttributeError: '_socketobject' object has no attribute 'set_tlsext_host_name'
Wie behebe ich das?
ich brauchte, um 'sudo apt-get install libffi-dev' vor pyopenssl – laffuste