解决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: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)]
解决方案就是取消ssl验证;
aiohttp.Connector使用自定义创建ssl_context(有关如何创建ssl上下文对象,请参阅https://docs.python.org/3/library/ssl.html)。
也许您必须使用您的证书链正确配置上下文。
PS aiohttp.Connector(verify_ssl)禁用SSL证书验证。
在 ClientSession()传入ssl 配置
import asyncio
import sys
import pymysql.cursors
from aiohttp import ClientSession
from aiohttp import TCPConnector async def postmsg(url,msg):
async with ClientSession(connector=TCPConnector(verify_ssl=False)) as session:
# data={"msgtype":"text","text":{"content":msg},"at":{"atMobiles":["17633919216"],"isAtAll":"false"}}
async with session.post(url,data=json.dumps(msg),headers=headers) as response:
response = await response.read()
# print(response)
return response
解决pyhton aiohttp ssl:None [[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)的更多相关文章
- 【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 ...
- 【python3】urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>
在玩爬虫的时候,针对https ,需要单独处理.不然就会报错: 解决办法:引入 ssl 模块即可 核心代码 imort ssl ssl._create_default_https_context = ...
- ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:847)
/******************************************************************************* * ssl.SSLError: [SS ...
- [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 ...
- [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 ...
- Let'sencrypt.sh 抛出异常: Response: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)>
起因 今天网站的SSL证书过期了,打算重新申请,运行 Let'sencrypt.sh 的时候抛出了这么个异常. 一番搜索,发现居然找不到直接的答案.没有直接的答案就只能通过间接的答案来解决了. 希望我 ...
- urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>
解决办法: import ssl # 在请求之前加上 ssl._create_default_https_context = ssl._create_unverified_context
- 执行buildman --fetch-arch arm提示"urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>"如何处理?
答: 在uboot源码的tools/buildman/toolchain.py中取消证书验证,修改内容如下: diff --git a/tools/buildman/toolchain.py b/to ...
随机推荐
- 不支持PowerShell 2.0版本(don't support PowerShell version 2.0. )
在“程序包管理器控制台”使用命令“update-database”会提示:The Entity Framework Core Package Manager Console Tools don't s ...
- MS SQL update set select
有张表a,已经有数据 再有张表b,也已查询出数据 两张表有外键关联 需求如下: 更新表a中的某个字段,这个字段要加上(都是int型的数据)对应表b中的数据作为更新的最终数据 )) from #libL ...
- 使用pygame制作一个简单的游戏
翻译自Will McGugan的<Beginning Game Development with Python and Pygame –From Novice to Professional&g ...
- Web项目的导出和部署
-----------------siwuxie095 Web 项目的导出 工程结构目录如下: ...
- datanode与namenode的通信原理
在分析DataNode时, 因为DataNode上保存的是数据块, 因此DataNode主要是对数据块进行操作. **A. DataNode的主要工作流程:** 1. 客户端和DataNode的通信: ...
- 实现hadoop中的机架感知
hadoop中声明是有机架感知的功能,能够提高hadoop的性能.平时我们使用的hadoop集群,实际上是从来没有使用上这个功能的. hadoop中所说的 机架感知的实现实际上这样的: hadoop启 ...
- 17.[CVE-2017-12615]Tomcat任意文件上传漏洞
[CVE-2017-12615] Tomcat任意文件上传漏洞 首先先贴出wooyun上的一个案例:http://wooyun.jozxing.cc/static/bugs/wooyun-2015-0 ...
- MVC过滤大法(过滤静态文件)
参考文章:https://prerakkaushik.wordpress.com/2014/02/12/routing-request-for-static-files-with-or-without ...
- Spring Cloud 简介
SpringCloud 简介 SpringCloud是一个基于SpringBoot实现的微服务架构开发工具.它为微服务架构中涉及的配置管理.服务治理.断路器.智能路由.微代理.控制总线.全局锁.决策竞 ...
- [WIP]Vue CLI
更新: 2019/05/30 文档: https://cli.vuejs.org/zh/ 安装 npm install -g @vue/cli 确认是否成功安装 vue --version 基础 ...