关于requests.exceptions.SSLError: HTTPSConnectionPool(host='XXX', port=443)问题

在运行一下代码的时候,会进行报错

requests.exceptions.SSLError: HTTPSConnectionPool(host=‘XXX’, port=443)

解决方法如下:

1、先检查是否已安装requests的依赖安装包:

pip install cryptography

pip install pyOpenSSL

pip install certifi

2、如果已经安装依赖安装包,还会报错,则在请求后面加上verify=False就可以

3、如有这个报错
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
则:
import urllib3
urllib3.disable_warnings()
就可以了
————————————————
版权声明:本文为CSDN博主「大于壹」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_42210687/article/details/103480208

posted @ 2022-02-28 10:15  苍山。  阅读(2278)  评论(0编辑  收藏  举报