解决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)的更多相关文章

  1. 【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 ...

  2. 【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 = ...

  3. ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:847)

    /******************************************************************************* * ssl.SSLError: [SS ...

  4. [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 ...

  5. [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

    再用爬虫爬取数据的时候报错:[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) 好多博客我看都说是:网站证书 ...

  6. 豆瓣 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 ...

  7. Let'sencrypt.sh 抛出异常: Response: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)>

    起因 今天网站的SSL证书过期了,打算重新申请,运行 Let'sencrypt.sh 的时候抛出了这么个异常. 一番搜索,发现居然找不到直接的答案.没有直接的答案就只能通过间接的答案来解决了. 希望我 ...

  8. 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

  9. 执行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 ...

随机推荐

  1. url传参解决中文乱码

    跳转前: window.open("http://localhost:9728/content/agent/devolution.html?search_agent=" + enc ...

  2. python的语法糖

    # -*- coding: utf-8 -*-def deco(func): print("before myfunc() called.") func() print(" ...

  3. 安装python Matplotlib 库

    转:使用 python Matplotlib 库 绘图 及 相关问题  使用 python Matplotlib 库绘图      转:http://blog.csdn.net/daniel_ustc ...

  4. 6、RNA-Seq Analysis Pipeline

    Created by Dhivya Arasappan, last modified by Dennis C Wylie on Nov 08, 2015 This pipeline uses an a ...

  5. 第四课4、ROS客户端

    ROS客户端提供一些列库文件用于用户开发.它利用许多ROS概念并使它通过代码可以获取. 下面是ROS程序中的接口 ROSCPP客户端(c++客户端) 首先新建一个包 然后catkin_make一下 在 ...

  6. Entity Framework Code-First(1):Introduction

    Entity Framework Code-First: Learn Entity Framework Code-First in simple step-by-step tutorials. The ...

  7. 在Visual Studio开发的项目中引用GAC中的dll

    Open the windows Run dialog (Windows Key + r) Type C:\Windows\assembly\gac_msil. This is some sort o ...

  8. 3. 从零开始学CSRF

    为什么要拿CSRF来当“攻击手法系列”的开头篇呢?因为CSRF/XSRF我个人喜爱他的程度已经超过XSS了.如果说XSS是一个老虎,那么CSRF就是隐藏在暗处的蛇.‍‍‍‍‍‍ ‍‍相信现在很多人不明 ...

  9. 【Qt官方例程学习笔记】Raster Window Example(画笔的平移/旋转/缩放应用)

    这个例子显示了如何使用QPainter渲染一个简单的QWindow. 值得学习的内容 <QtGui>头文件 #include <QtGui>就可以使用Qt GUI模块中的所有类 ...

  10. Collectd+InfluxDB+Grafana监控系统搭建

    环境配置 节点 配置 类型 操作系统 Sched 2G 2CPU 50GB ens3=>192.168.200.11 KVM虚拟机 CentOS 7 Nova 4G 2CPU 50GB ens3 ...