使用Python,我试图通过基于证书的身份验证向请求发送REST请求,但有时我遇到以下异常:
requests.exceptions.SSLError: HTTPSConnectionPool(host='mywebsite', port=443): Max retries exceeded with url: /myurl (Caused by SSLError(SSLError("bad handshake: SysCallError(10054, 'WSAECONNRESET')")))
我正在使用python3.7.2,并在代理之后发送请求。在
这是我的实际代码:
response = requests.request("POST", url, data=payload, proxies=PROXY, headers=headers, cert=("cert.pem", "key.key"))
我希望得到一个JSON响应,但有时会出现以下异常:
OpenSSL.SSL.SysCallError: (10054, 'WSAECONNRESET')
During handling of the above exception, another exception occurred:ssl.SSLError: ("bad handshake: SysCallError(10054, 'WSAECONNRESET')",)
During handling of the above exception, another exception occurred:urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='mywebsite', port=443): Max retries exceeded with url: /myurl (Caused by SSLError(SSLError("bad handshake: SysCallError(10054, 'WSAECONNRESET')")))
During handling of the above exception, another exception occurred:requests.exceptions.SSLError: HTTPSConnectionPool(host='mywebsite', port=443): Max retries exceeded with url: /myurl (Caused by SSLError(SSLError("bad handshake: SysCallError(10054, 'WSAECONNRESET')")))
目前没有回答
相关问题 更多 >
编程相关推荐