0
点赞
收藏
分享

微信扫一扫

【RocketMQ】CentOS8安装RocketMQ

殇感故事 2023-07-04 阅读 35

报错信息

requests.exceptions.SSLError: HTTPSConnectionPool(host='https://www.youtube.com/', port=443): 
Max retries exceeded with url: / (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation 
of protocol (_ssl.c:1125)')))

原因

urllib3 1.26之后更新了主架构

urllib3 1.26

proxy = { 'https': 'http://127.0.0.1: 80' }

urllib3 schema旧版

proxies ={
  'http':'http://127.0.0.1: 80',
  'https':'https://127.0.0.1: 80'
}

解决方案

方法一

降低版本为1.25.11(本人使用该方法,比较通用)

pip install urllib3==1.25.11

方法二

VPNip拷贝出来作为requests的代理使用,然后本机不挂梯子则不会报错

import requests
proxies ={
  'http':'http://127.0.0.1: 80',
  'https':'https://127.0.0.1: 80'
}

requests.get(url,headers=headers,proxies=proxies)
举报

相关推荐

0 条评论