requests SSLError

使用requests发起接口请求,报错如下:

OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]

ssl.SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",)

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='xxxxx', port=443): Max retries exceeded with url: ... (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

requests.exceptions.SSLError: HTTPSConnectionPool(host='xxxxx', port=443): Max retries exceeded with url: ... (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

在requests.get参数中加上verify=False

注:脚本运行期间需要关闭代理工具!!!(如果脚本运行期间开启了代理工具,如fiddler或者charles也会报上述错误,关闭就可以了。)

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页