gpt4 book ai didi

python - SSL 错误发生在一台计算机上,但另一台计算机上没有?

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

我不明白为什么下面使用 Asana 的 API 的代码会突然生成下面的 SSL 错误。我的笔记本电脑上一定发生了一些变化,因为它在我的另一台电脑上运行完美。

from asana import asana

class Login(object):
def __init__(self):
api = 'API'
self.asana_api = asana.AsanaAPI(api, debug=False)
self.user_id = 7359085011308L

class Test(Login):
def Test(self):
Id = 2467584555313L
print self.asana_api.list_tasks(Id,self.user_id)


Traceback (most recent call last):
File "/Users/Chris/Dropbox/AsanaPullPush.py", line 75, in <module>
if __name__ == "__main__": main()
File "/Users/Chris/Dropbox/AsanaPullPush.py", line 72, in main
print Test().Test()
File "/Users/Chris/Dropbox/AsanaPullPush.py", line 15, in Test
print self.asana_api.list_tasks(Id,self.user_id)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/asana/asana.py", line 174, in list_tasks
return self._asana(target)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/asana/asana.py", line 74, in _asana
r = requests.get(target, auth=(self.apikey, ""))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/api.py", line 55, in get
return request('get', url, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/sessions.py", line 383, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/sessions.py", line 486, in send
r = adapter.send(request, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/adapters.py", line 389, in send
raise SSLError(e)
requests.exceptions.SSLError: [Errno 1] _ssl.c:507: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm

最佳答案

我们最近更改了 SSL key 以响应您可能听说过的 Heartbleed 错误。 http://blog.asana.com/2014/04/heartbleed/

看起来您的笔记本电脑可能没有正确的 SSL。参见 https://github.com/pypa/pip/issues/829用于讨论类似问题。

您应该能够使用 python -c "import ssl; print ssl.OPENSSL_VERSION" 检查两台机器上的 SSL 版本。如果确实是笔记本电脑落后,则需要更新 Python 的 SSL。

关于python - SSL 错误发生在一台计算机上,但另一台计算机上没有?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23002438/

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