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 ...
随机推荐
- 默认网关和默认路由 —— Cisco CCNA – Default Gateway & Default Routes
原文:https://www.certificationkits.com/cisco-certification/ccna-articles/cisco-ccna-intro-to-routing-b ...
- CAD打开慢,卡在99%
问题描述 打开AutoCAD的时候,软件停留在加载99%,点击出现[无法响应],要么等待,要么强行关闭,若平时正常关闭CAD时也异常缓慢. 原因分析 破解版,没有联网就激活了.CAD默认启动需要联网, ...
- STL 源代码剖析 算法 stl_algo.h -- partial_sort / partial_sort_copy
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie partial_sort / partial_sort_copy ------------- ...
- 关于"引用"的几点说明
一.引用的基本知识 引用就是某一变量(目标)的一个别名,对引用的操作与对变量直接操作完全一样.引用的声明方法:类型标识符 &引用名=目标变量名: 说明: (1)&在此不是求地址运算,而 ...
- KeyBoardUtils.java——android键盘工具类
package com.xdsjs.save.utils; import android.content.Context; import android.view.inputmethod.InputM ...
- html-webpack-plugin插件 根据模板生成多页面
1.项目目录结构为: 2.webpack.config.js配置文件为: var htmlWebpackPlugin = require('html-webpack-plugin'); module. ...
- windows彻底删除Oralce
以下是彻底删除Oralce的步骤:1. 开始->设置->控制面板->管理工具->服务停止所有Oracle服务. 2. 开始->程序->Oracle - OraHom ...
- 在Tomcat下指定Jsp生成的Java文件路径
在tomcat的配置文件server.xml(路径:tomcat路径\conf下面)里,找到:<Context docBase="D:/workspace/icinfo/trunk/w ...
- 为什么需要设置pythonpath环境变量?
# -*- coding: utf-8 -*- #python 27 #xiaodeng #为什么需要设置pythonpath环境变量? #只需设置pythonpath,从而可以从正在用的目录(也就是 ...
- java 加密工具(产生证书)
给Tomcat服务器应用加密: 命令:keytool -genkey -alias tomcat -keyalg RSA -genkey产生密钥对 -alias取得别名 -keyalg RSA产生密钥 ...