requests ssl
时间: 2023-08-26 08:05:13 浏览: 134
Requests是一个Python库,用于发起HTTP请求。它可以验证HTTPS请求的SSL证书,就像web浏览器一样。默认情况下,SSL验证是开启的,如果证书验证失败,Requests会抛出SSLError异常。
如果你想修改Requests中的TLS握手特征或修改加密算法,可以修改urllib3库中的ssl上下文,并实现一个新的HTTP适配器(HTTPAdapter)。相关的代码路径是"/usr/local/lib/python3.9/site-packages/urllib3/util/ssl_.py"。
当然,如果你将verify参数设置为False,Requests也可以忽略对SSL证书的验证。但请注意,这样做存在安全风险,因为无法确保你与目标服务器之间的连接是安全的。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Pyhon : 爬虫Requests高级用法--SSL 证书验证](https://blog.csdn.net/weixin_44523387/article/details/90732396)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [Requests中SSl指纹识别问题解决](https://blog.csdn.net/pengshengege/article/details/122023190)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文