python - urllib2 - 能够跳过证书验证

标签 python ssl urllib2

我需要为 curl 以某种方式模拟选项 -k(vide --insecure 以忽略 SSL 证书验证)但使用 urllib2。有什么线索吗?

最佳答案

这里没什么特别的。 urllib2 默认不做SSL证书验证。文档中有警告 http://docs.python.org/library/urllib2.html

Warning HTTPS requests do not do any verification of the server’s certificate.

关于python - urllib2 - 能够跳过证书验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11724765/

相关文章:

Python:使用 url 从谷歌驱动器下载文件

python - 为什么 urllib.urlopen(url) 失败而 urllib2.urlopen(url) 有效。服务器响应的具体原因是什么?

python - 如何获取谷歌翻译结果(个人使用)?旧技术不再适用

python - 使用和不使用 ':' 运算符删除 python 中的列表

python - wxpython 从 ID 访问对象

python - 如何获取用户输入并在 python 中进行搜索?

firefox - 允许使用 Firefox 的 SSL 中间人

python - 无法使用 cygwin 运行 pexect

java - Spring 休息模板 : Host name 'localhost' does not match the certificate subject provided by the peer

docker - Dockerized Nginx无法加载证书