报错信息: SSLError: HTTPSConnectionPool(host='x.x.x.x', port=8443): Max retries exceeded with url: /rest/v1/xx/yy/zz (Caused by SSLError(SSLError(8, '_ssl.c:503: EOF occurred in violation of protocol'),))
直接上解决方案:
pip install ndg-httpsclient
Requirement already satisfied: pyasn1>=0.1.1 in ./site-packages (from ndg-httpsclient) (0.3.6)
Requirement already satisfied: six>=1.5.2 in ./site-packages (from PyOpenSSL->ndg-httpsclient) (1.16.0)
Requirement already satisfied: cryptography>=3.3 in ./site-packages (from PyOpenSSL->ndg-httpsclient) (3.3.2)
Requirement already satisfied: ipaddress; python_version < "3" in ./site-packages (from cryptography>=3.3->PyOpenSSL->ndg-httpsclient) (1.0.23)
Requirement already satisfied: enum34; python_version < "3" in ./site-packages (from cryptography>=3.3->PyOpenSSL->ndg-httpsclient) (1.1.10)
Requirement already satisfied: cffi>=1.12 in ./site-packages (from cryptography>=3.3->PyOpenSSL->ndg-httpsclient) (1.15.1)
Requirement already satisfied: pycparser in ./site-packages (from cffi>=1.12->cryptography>=3.3->PyOpenSSL->ndg-httpsclient) (2.21)Successfully installed PyOpenSSL-21.0.0 ndg-httpsclient-0.5.1
我的是python2.7的版本。
HTTP请求出的问题,感觉是urllib3和requests导致的。
参考:ssl - Python requests.exceptions.SSLError: EOF occurred in violation of protocol - Stack Overflow