[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed


1、在vs编写时出现这个问题(以下为网络查询结果)
问题的原因是“SSL: CERTIFICATE_VERIFY_FAILED”。
Python 升级到 2.7.9 之后引入了一个新特性,当使用urllib.urlopen打开一个 https 链接时,会验证一次 SSL 证书。
而当目标网站使用的是自签名的证书时就会抛出一个 urllib2.URLError: 的错误消息,详细信息可以在这里查看:
https://www.python.org/dev/peps/pep-0476/
解决方案包括下列两种方式:
1. 使用ssl创建未经验证的上下文,在urlopen中传入上下文参数
import ssl
import urllib.request
context = ssl.__create__unverified__context()
print(urllib.request.urlopen("网址").read())
或者(我是用这种方法处理的)
import ssl
import urllib.request
ssl.__create__default__https__context = ssl.__create__unverified__context
2、在pip时遇到此问题
我是在用Fiddler的同时pip所以出现问题,关掉就行了(我还关掉了火狐的手动设置代理)
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed的更多相关文章
- ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:847)
/******************************************************************************* * ssl.SSLError: [SS ...
- 【Python】【BugList13】req = requests.get(url=target)报错: (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)')
[代码] # -*- coding:UTF-8 -*- import requests if __name__ == '__main__': target = 'https://unsplash.co ...
- Python [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 解决方法
一个搭建在SAE上的Django应用,使用新浪微博提供的Python SDK已经稳定运行一年有余,但最近开始持续出现微博认证失败的状况. 摘录微博python SDK的错误提示如下所示: ERROR: ...
- [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)
Could not fetch URL https://pypi.python.org/simple/six/: There was a problem confirming the ssl cert ...
- urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed解决办法
描述 今天学习写一篇用python(我的是Python 3.6)登录知乎网(https://www.zhihu.com) 的爬虫,测试时报错:urlopen error [SSL: CERTIFICA ...
- 解决pyhton aiohttp ssl:None [[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)
解决pyhton aiohttp ssl:证书报错问题, 错误信息> Cannot connect to host oapi.dingtalk.com:443 ssl:None [[SSL: C ...
- [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)
再用爬虫爬取数据的时候报错:[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) 好多博客我看都说是:网站证书 ...
- 豆瓣 URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:719)>
import urllib.request as urlrequest #import ssl#ssl._create_default_https_context = ssl._create_unve ...
- Mac 下python3 [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 解决方法
原文:http://blog.yuccn.net/archives/625.html python3.6下使用urllib 的request进行url 请求时候,如果请求的是https,请求可以会出现 ...
- [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)'))) - skipping
C:\Users>pip listPackage Version------------ -------behave 1.2.6configparser 3.7.4ddt 1.2.1parse ...
随机推荐
- A fine property of the non-empty countable dense-in-self set in the real line
A fine property of the non-empty countable dense-in-self set in the real line Zujin Zhang School o ...
- CentOS7.3安装VirtualBox
安装 DKMS.更新内核 # yum -y install gcc make glibc kernel-headers kernel-devel dkms Installed: dkms.noar ...
- Linux中安装C++编译器codeBlock,并配置opencv链接库
1.Linux中安装codeBlock https://blog.csdn.net/xinyunyishui/article/details/50967395 2.CodeBlock中的中文显示不完全 ...
- 第30月第6天 git log
1. git log git log 96a6f18b1e0a1b7301cb4f350537d947afeb22bc -p -1 我们常用 -p 选项展开显示每次提交的内容差异,用 -2 则仅显示最 ...
- Linux设置SSH登录(SecureCrt)
背景 每次登录需要输入复杂的密码,而且不停的有人在尝试登录root账户.感觉心慌慌,所以不得不设置更加安全的登录方式. 配置SSH无密码登录需要4步 准备工作 生成公钥和私钥 导入公钥到认证文件,更改 ...
- how2heap学习笔记
github源代码地址 这里只分析glibc2.25堆分配的特性,为了方便调试编译时使用 gcc -g -no-pie <input_file_name> -o <output_fi ...
- fs.inotify.max_user_watches默认值太小,导致too many open files
运行环境:centos7.5 linux 打开文件数 too many open files 解决方法fs.inotify.max_user_watches默认值太小,导致too many open ...
- SpringBoot 集成数据库连接池Druid
1.pom.xml依赖 <dependency> <groupId>com.alibaba</groupId> <artifactId>druid< ...
- Java中多线程服务中遇到的Redis并发问题?
背景: 一个中小型H5游戏 核心错误信息: (1): java.lang.ClassCastException: [B cannot be cast to java.lang.Long at redi ...
- ThinkPHP5配置redis缓存
thinkphp采用cache类提供缓存功能支持,采用驱动方式,在使用缓存之前需要进行初始化操作.支持的缓存类型包括file.memcache.wincache.sqlite.redis和xcache ...