disable default certificate verification in python 2.7.8
来源:互联网 发布:严宽乔振宇 知乎 编辑:程序博客网 时间:2024/05/21 19:29
环境:Python 2.7.8
浏览器中访问该网站时会弹出证书不受信任,但是忽略仍可继续访问。
python 中若继续访问时则需关闭SSL 认证请求。在python 2.7.8 中ssl模块并不存在
ssl._create_default_https_context = ssl._create_unverified_context
而需使用另一种方法进行关闭,如下代码所示:
...requests.get(url=url, headers=headers,verify=False)...
只需将verify关闭。
关闭后会有警告信息提示
C:\Python27\lib\site-packages\urllib3\util\ssl_.py:339: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
SNIMissingWarning
C:\Python27\lib\site-packages\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
C:\Python27\lib\site-packages\urllib3\connectionpool.py:858: 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)
- disable default certificate verification in python 2.7.8
- Disable Certificate Validation in Java SSL Connections
- PEP 0476 -- Enabling certificate verification by default for stdlib http clients
- ubuntu server certificate verification failed.
- Hudson,Server certificate verification failed:
- Jenkins-Server certificate verification failed
- html5 default action disable
- Default Parameter Values in Python
- Win10 Disable Driver Sign verification (Disable Signed Driver Enforcement mode)
- error: server certificate verification failed 解决方案
- git clone server certificate verification failed
- QA in verification
- In-app purchase verification
- Server certificate verification failed: certificate has expired, certificate issued for a different
- Disable touchpad in Linux
- Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default key
- Download android source code occur "server certificate verification failed "
- lftp出现“Fatal Error: Certificate Verification: Not Trusted”问题解决
- 浮点数在内存中的存储形式
- CF2017.10.5 C. Qualification Rounds
- mysql触发器
- SPI写解析
- 走穿java23种设计模式-4建造者模式详解
- disable default certificate verification in python 2.7.8
- 如何隐藏手机号码
- 如何在caffe中添加新的Layer
- CSharp第一讲-基本语法
- Lintcode139 Subarray Sum Closest solution 题解
- 华为机考笔试题-删数
- 鸡兔同笼问题
- 收集游戏制作的图片
- React Native之PanResponder