InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings In
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised.
See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
出现这个错误的原因是:
requests 库其实是基于 urllib 编写的,对 urllib 进行了封装,使得使用时候的体验好了很多,现在 urllib 已经出到了3版本,功能和性能自然是提升了不少。
所以,requests最新版本也是基于最新的 urllib3 进行封装。 在urllib2时代对https的处理非常简单,只需要在请求的时候加上 verify=False 即可,这个参数的意思是忽略https安全证书的验证,也就是不验证证书的可靠性,直接请求,
这其实是不安全的,因为证书可以伪造,不验证的话就不能保证数据的真实性。 在urllib3时代,官方强制验证https的安全证书,如果没有通过是不能通过请求的,虽然添加忽略验证的参数,但是依然会 给出醒目的 Warning,这一点没毛病。
解决办法:
添加两行代码 禁用 urllib3
import urllib3
urllib3.disable_warnings()
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings In的更多相关文章
- InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised.解决办法
最近使用requests进行get请求的时候,控制台输出如下错误. InsecureRequestWarning: Unverified HTTPS request is being made. Ad ...
- https://pyobjc.readthedocs.io/en/latest/
https://pyobjc.readthedocs.io/en/latest/ The PyObjC project aims to provide a bridge between the Pyt ...
- https://uwsgi-docs.readthedocs.io/en/latest/Async.html
Beware! Async modes will not speed up your app, they are aimed at improving concurrency. Do not expe ...
- SICP 解题集 — SICP 解题集 https://sicp.readthedocs.io/en/latest/
SICP 解题集 - SICP 解题集 https://sicp.readthedocs.io/en/latest/
- https://channels.readthedocs.io/en/latest/tutorial/part_2.htmlhttps://channels.readthedocs.io/en/latest/tutorial/part_2.html
https://channels.readthedocs.io/en/latest/tutorial/part_2.html
- https://design-patterns.readthedocs.io/zh_CN/latest/index.html
图说设计模式 - Graphic Design Patterns https://design-patterns.readthedocs.io/zh_CN/latest/index.html
- pytest文档46-关于https请求警告问题(InsecureRequestWarning: Unverified HTTPS request is being made)
前言 使用 pytest 执行 https 请求用例的时候,控制台会出现警告:InsecureRequestWarning: Unverified HTTPS request is being mad ...
- lua https request 调用
网上资料 引用ssl.https 包 local https = require("ssl.https") 之后按同http一样调用. 但是,这种只最基本的实现了访问https服务 ...
- Username for 'https://github.com': remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/GLSmile/pythontest.git/' 问题
使用$ git push -u origin master 进行同步时,提示输入用户名和密码,但是我输入正确的信息后,仍然 会报Username for 'https://github.com': r ...
随机推荐
- Tomcat7出现HTTP Status 500 - java.lang.ClassCastException: org.apache.jasper.el.ELContextImpl cannot be cast to org.apache.jasper.el.ELContextImpl的解决
今天在Tomcat7上发布了一个war,过一阵子发现localhost:8080都进不去了.在浏览器输入http://localhost:8080出现如下内容: HTTP Status 500 - j ...
- ThinkPHP3.2 新bug ReadHtmlCache 支持不区分大写和小写的函数
报错提示: Fatal error: Function name must be a string in D:\wwwroot\zbphp.com\ThinkPHP\Library\Behavior\ ...
- Activity基本跳转
详细解释:http://blog.csdn.net/xiazdong/article/details/7664757 简单介绍activity的跳转,通过intent实现,详细的注释在代码中.涉及到a ...
- 微信小程序 - 各种示例
示例更新(后续持续更新): 最后一次更新:2018-11-7 小程序-地图显示(调用高德地图.腾讯App) - (2018-11-1) 小程序-上传图片(上传.预览.展示.删除) - (2018-11 ...
- Tomcat之安装篇- 1
1. 提供了下载页面 以及tomcat下载地址,点击即可下载 : Tomcat9.0(Windows64) 方便好用的录像机下载请点击: gif工具 即可下载. 2.下载好的压缩包进行解压 3.配置路 ...
- Java从零开始学三十七(JAVA IO- 二进制文件读写)
一.简述 二.使用步骤 DataInputStream: 引入相关的类 构造数据输入流的对象(如:FileInputStream,BufferedWriter包装后读取文件等) 读取二进制文件的数据 ...
- Sql_Handle and Plan_Handle Explained
For batches, the SQL handles are hash values based on the SQL text. For database objects such as sto ...
- navicat ora-28547:connection to server failed
navicat ora-28547:connection to server failed CreationTime--2018年8月9日18点47分 Author:Marydon 1.情景还原 ...
- import 如何工作
# -*- coding: utf-8 -*- #python 27 #xiaodeng #import 如何工作 #程序第一次导入指定文件时,会执行三个步骤 #1)找到模块文件 #2)编译成位码(需 ...
- SET GLOBAL FOREIGN_KEY_CHECKS取消外键约束
今天在工作中遇到的问题,在删除一个表时报错,发现有外键约束,所以不能删除,查了下发现需要取消外键约束. SET GLOBAL FOREIGN_KEY_CHECKS=0;全局取消外键约束 SET SES ...