gpt4 book ai didi

python请求ssl握手失败

转载 作者:太空宇宙 更新时间:2023-11-03 14:40:23 25 4
gpt4 key购买 nike

每次我尝试做:

requests.get('https://url') 

我收到这条消息:

import requests
>>> requests.get('https://reviews.gethuman.com/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,无法更改。

最佳答案

在 OSX 上,使用 python 2.7.10/requests 2.9.1 我只需要使用其安全设置安装 requests:

pip install requests[security]

这会安装 pyOpenSSLndg-httpsclientpyasn1https://github.com/kennethreitz/requests/blob/master/setup.py#L70

关于python请求ssl握手失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43792572/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com