W Pythonie na serwerze Ubuntu, staram się dostać do biblioteki requests
aby HTTPS, tak:AttributeError: „_socketobject” obiekt ma atrybut „set_tlsext_host_name”
import requests
requests.post("https://example.com")
Początkowo ja mam następujące:
/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 .
Po wykonaniu rady w tej kwestii: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately, mam teraz zmodernizowane moje ostrzeżenie następującego błędu:
AttributeError: '_socketobject' object has no attribute 'set_tlsext_host_name'
Jak to naprawić?
Musiałem 'sudo apt-get install libffi-dev' przed zainstalowaniem pyopenssl – laffuste