requests.exceptions.SSLError: HTTPSConnectionPool

Published on with 0 views and 0 comments

以前用的好好的脚本,这几天一直报这个错。经过查询时证书验证的错误。

报错:requests.exceptions.SSLError: HTTPSConnectionPool(host='tc.ltyuanfang.cn', port=443): Max retries exceeded with url: /api/token (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

解决方法:

login = requests.post(url=url_token, data=payload,verify=False).text
  • 请求参数加上跳过验证:verify=False

然后,引入代码:

import urllib3
urllib3.disable_warnings()

标题:requests.exceptions.SSLError: HTTPSConnectionPool
作者:cuijianzhe
地址:https://cjzshilong.cn/articles/2020/08/08/1596867654155.html