解决python urllib3报错urllib3.exceptions.MaxRetryError xxx [SSL: CERTIFICATE_VERIFY_FAILED] xxx

完整报错如下:
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='xxxxx', port=443): Max retries exceeded with url: xxxxxxx (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))

解决方法

创建连接池时,使用:

import urllib3

http = urllib3.PoolManager(cert_reqs='CERT_NONE')

猜你喜欢

转载自blog.csdn.net/weixin_35757704/article/details/121060876
今日推荐