python请求ssl握手失败

编程入门 行业动态 更新时间:2024-10-28 14:22:36
本文介绍了python请求ssl握手失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

每次我尝试这样做:

requests.get('url')

我收到了这条消息:

import requests >>> requests.get('reviews.gethuman/companies') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/dist-packages/requests/api.py", line 55, in get return request('get', url, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 455, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 558, in send r = adapter.send(request, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 385, in send raise SSLError(e) requests.exceptions.SSLError: [Errno 1] _ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

我什么都试过了:

  • 更新我的请求
  • 更新我的 ssl

但没有任何变化.

我使用的是 Python 2.7.6,无法更改.

I am using Python 2.7.6, can't change this.

推荐答案

最后我解决了我的 ubuntu 从 14.04 更新到 14.10 问题解决了

I resolve the problem in the end i updated my ubuntu from 14.04 to 14.10 and the problem was solved

但是在旧版本的 ubuntu 和 python 中,我安装了这些库,它似乎解决了我所有的问题

but in the older version of ubuntu and python I install those lib and it seems to fix all my problems

sudo apt-get install python-dev libssl-dev libffi-dev sudo pip2.7 install -U pyopenssl==0.13.1 pyasn1 ndg-httpsclient

如果你没有安装 pip2.7 你可以用 pip 代替

if you don`t have pip2.7 installed you can use pip instead

更多推荐

python请求ssl握手失败

本文发布于:2023-06-02 14:47:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/447330.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:python   ssl

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!