Python让程序忽略SSL证书验证错误

Python让程序忽略SSL证书验证错误

# 1. 导入Python SSL处理模块
import ssl

# 2. 表示忽略未经核实的SSL证书认证
context = ssl._create_unverified_context()
......
# 3. 在urlopen()方法里 指明添加 context 参数
response = urllib2.urlopen(request, context = context)

猜你喜欢

转载自blog.csdn.net/ithongchou/article/details/83719542
今日推荐