SSLError(SSLError(8, ‘_ssl.c:503: EOF occurred in violation of protocol‘)

报错信息:
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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值