requests.exceptions.SSLError: HTTPSConnectionPool(host='www.baidu.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),))

 
错误提示就是上面这样的。首先我找了很多的资料,有很多人说关闭证书验证(verify=False))可以解决这个问题或者说是在进行GET时,指定SSL证书.
response = requests.get('http://www.baidu.com/', headers = header, verify=False)  
但我用以上两种方法都没有完美解决此问题,而且有些还有后续错误比如InsecureRequestWarning

正确的做法参考文档资料

https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl

参考博客:http://blog.csdn.net/zahuopuboss/article/details/52964809

只要安装一下几个requests依赖包就可以解决此问题

pip install cryptography

pip install pyOpenSSL

pip install certifi

原文转至博客:https://blog.csdn.net/qq_31077649/article/details/79013199

requests.exceptions.SSLError报错的更多相关文章

  1. python使用requests时报错requests.exceptions.SSLError: HTTPSConnectionPool

    报错信息 Traceback (most recent call last): File "<stdin>", line 1, in <module> Fi ...

  2. Python中request的post请求报requests.exceptions.SSLError:

    今天发送一个post请求,提示错误 requests.exceptions.SSLError: HTTPSConnectionPool(host='user.zaful.com', port=443) ...

  3. 解决python爬虫requests.exceptions.SSLError: HTTPSConnectionPool(host='XXX', port=443)问题

    爬虫时报错如下: requests.exceptions.SSLError: HTTPSConnectionPool(host='某某某网站', port=443): Max retries exce ...

  4. 关于requests.exceptions.SSLError: HTTPSConnectionPool

    问题: requests.exceptions.SSLError: HTTPSConnectionPool(host='mall.christine.com.cn', port=443): Max r ...

  5. pycharm fiddler requests.exceptions.SSLError

    一.SSL问题1.不启用fiddler,直接发https请求,不会有SSL问题(也就是说不想看到SSL问题,关掉fiddler就行) 2.启动fiddler抓包,会出现这个错误:requests.ex ...

  6. requests.exceptions.SSLError……Max retries exceeded with url错误求助!!!

    import requests head = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Appl ...

  7. python导入requests库一直报错原因总结 (文件名与库名冲突)

    花了好长时间一直在搞这个 源代码: 一直报如下错误: 分析原因: 总以为没有导入requests库,一直在网上搜索各种的导入库方法(下载第三方的requests库,用各种命令工具安装),还是报错 后来 ...

  8. Python - requests发送请求报错:UnicodeEncodeError: 'latin-1' codec can't encode characters in position 13-14: 小明 is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.

    背景 在做接口自动化的时候,Excel作为数据驱动,里面存了中文,通过第三方库读取中文当请求参数传入 requests.post() 里面,就会报错 UnicodeEncodeError: 'lati ...

  9. requests.exceptions.SSLError: hostname '127.0.0.1' doesn't match None

    http://stackoverflow.com/questions/33429453/python-requests-ssl-hostname-doesnt-match-error http://w ...

随机推荐

  1. 由情感计算带来的惊喜发现——记Rosalind W. PICARD“21世纪的计算”大会主题演讲

    W. PICARD"21世纪的计算"大会主题演讲" title="由情感计算带来的惊喜发现--记Rosalind W. PICARD"21世纪的计算& ...

  2. LeetCode Day 7

    LeetCode0012 罗马数字包含以下七种字符: I, V, X, L,C,D 和 M. 字符 I V X L C D M 数值 1 5 10 50 100 500 1000 例如, 罗马数字 2 ...

  3. lua https request 调用

    网上资料 引用ssl.https 包 local https = require("ssl.https") 之后按同http一样调用. 但是,这种只最基本的实现了访问https服务 ...

  4. whip|resist|patch|intimate|

    a piece of leather or rope that is fastened to a stick, used for hitting animals or people 鞭子,皮鞭 She ...

  5. win10安装MAYA失败,怎么强力卸载删除注册表并重新安装

    一些搞设计的朋友在win10系统下安装MAYA失败或提示已安装,也有时候想重新安装MAYA的时候会出现本电脑windows系统已安装MAYA,你要是不留意直接安装MAYA,只会安装MAYA的附件或者直 ...

  6. leetcode第23题:合并K个排序链表

    首先我想到的是采用一般递归法,将K个链表合并化为(k-1)两个链表合并 class Solution: def mergeKLists(self, lists: List[ListNode]) -&g ...

  7. 赫夫曼解码(day17)

    思路: 传入map(字节与对应字节出现的次数)和最后生成的要传送的字节.将他们先转换成对应的二进制字节,再转换成原来的字符串. 代码: 12345678910111213141516171819202 ...

  8. OSCache使用指南

    OSCache是当前运用最广的缓存方案, JBoss Hibernate Spring 等都对其有支持,下面简单介绍一下OSCache的配置和使用过程. 1.安装过程 从http://www.open ...

  9. MySQL5.6 数据库主从(Master/Slave)同步安装与配置详解

    .安装环境 .基本环境配置 .Master的配置 .Slave的配置 .添加需要同步的从库Slave .真正的测试 安装环境 1 操作系统 :CentOS 6.5 2 数据库版本:MySQL 5.6. ...

  10. React类型检查

    类型检查 import PropTypes from 'prop-types' 类名==List List.propTypes = { list: PropTypes.array } // 默认值 L ...