在使用urllib.request.Request(url)前,添加代码放到最前面

import ssl
 ssl._create_default_https_context = ssl._create_unverified_context


问题缘由:
因为访问的网站是https://,需要SSL认证,直接使用urllib会导致本地验证失败,所以使用ssl._create_unverified_context关闭认证

python解决urllib发送请求报错:urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:xxxx)>的更多相关文章

  1. python运行报错:urllib2.URLError: <urlopen error [Errno 10061] >

    Traceback (most recent call last): File "F:\adt-bundle-windows-x86_64-20140702\eclipse\workspac ...

  2. 使用git克隆仓库到本地报错:SSL certificate problem: unable to get local issuer certificate

    第一次使用Git工具克隆仓库,使用的是HTTPS链接,失败了.发现是因为通过HTTPS访问时,如果服务器上的SSL证书未经过第三方机构认证,Git就会报错. 解决方法:通过命令关闭验证 git con ...

  3. git中的SSL certificate problem: unable to get local issuer certificate错误的解决办法

    我们在使用git初始化一个项目时,尤其是通过git submodule update --init --remote初始化子模块时,可能会遇到下面这个错误: fatal: unable to acce ...

  4. cURL error 60: SSL certificate problem: unable to get local issuer certificate 解决方法

    微信开发的时,请求接口报错如下: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see ...

  5. SSL certificate problem: unable to get local issuer certificate 错误解决

    终端报了如下错误git SSL certificate problem: unable to get local issuer certificate 这个问题是由于没有配置信任的服务器HTTPS验证 ...

  6. SSL certificate problem unable to get local issuer certificate解决办法

    SSL certificate problem unable to get local issuer certificate 解决办法: 下载:ca-bundle.crt 将它放在自己的wamp或者x ...

  7. SSL certificate problem: unable to get local issuer certificate 的解决方法

    今天在进行微信开发获取微信Access_Token时,使用到了php的curl库, 在敲完代码后获取token失败,经过各种排查错误,到了下面这一步 SSL certificate problem: ...

  8. PHP出现SSL certificate:unable to get local issuer certificate的解决办法

    当本地curl需要访问https时,如果没有配置证书,会出现SSL certificate: unable to get local issuer certificate错误信息. 解决办法: 1.下 ...

  9. Python - requests发送请求报错:UnicodeEncodeError: 'latin-1' codec can't encode characters in position 13-14: 小明 is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.

    背景 在做接口自动化的时候,Excel作为数据驱动,里面存了中文,通过第三方库读取中文当请求参数传入 requests.post() 里面,就会报错 UnicodeEncodeError: 'lati ...

  10. #python# error:urllib.error.URLError: <urlopen error [Errno 11001] getaddrinfo failed>

    设置代理后访问网页报错,百度有人说地址拼写不对,确认拼写后依然报错 因为使用的是xici免费代理,想到可能代理不可用造成getaddrinfo failed, 更换其他代理,error消失

随机推荐

  1. github无法提交代码问题

    问题描述 提交代码到个人仓库的时候发现报错,认证失败 Username for 'https://github.com': hywing Password for 'https://hywing@gi ...

  2. docker——health(容器的健康检查)

    容器的健康检查机制 了解在dockerfile中容器的健康检查 # 在dockerfile中使用healthcheck指令,声明健康检测配置,用于判断容器主进程的服务状态是否正常,反映容器的实际健康状 ...

  3. GNU gprof分析C性能

    参考 gprof的简单使用-anthony1983-ChinaUnix博客 Top (GNU gprof) (sourceware.org) c - Enable and disable gprof ...

  4. C#.NET 使用HttpWebRequest发送JSON

    方法: public static string HttpPostJson(string url, string postStr, int timeOut, string charset) { Htt ...

  5. Winform绘制圆形图

    1 private void Form_Load(object sender, EventArgs e) 2 { 3 PictureBox pic = new PictureBox(); 4 pic. ...

  6. redis安全篇

    redis被攻击,作为突破口,服务器惨遭毒手的事太常见了. 大多数云服务器被攻击,都是redis,mongodb等数据库被入侵. 因此修改端口,密码,以及注意bind运行地址,是必须. 思考是否要暴露 ...

  7. ssh基础

    SSH安全登录 机器准备 什么是SSH SSH 或 Secure Shell 协议是一种远程管理协议,允许用户通过 Internet 访问.控制和修改其远程服务器. SSH 服务是作为未加密 Teln ...

  8. 在线SQL格式化工具推荐

    在线SQL格式化工具,一键美化.整理您的SQL代码,支持多种数据库语法格式化.有效提升代码可读性,方便团队协作与快速定位问题,是开发人员必备的SQL编程助手,让复杂查询更清晰,更易于维护. 在线SQL ...

  9. Docker PHP如何启用MySQL扩展

    我下载的镜像是PHP7版本:docker pull php:7.4.30-fpm,容器起名为php7 PHP镜像官方提供了帮助文档,其中提到了相关的命令,这里推荐一篇博客,该博客对于扩展的几个相关命令 ...

  10. Django项目实现分页返回,结合forloop实现编号递增

    需要导入Paginator包 from django.core.paginator import Paginator 实现步骤: 需要设置每页大小 需要获取每页的页码, 查询对应的数据,提供给Pagi ...