gpt4 book ai didi

linux - Google Assistant 获取 SSL 错误

转载 作者:太空宇宙 更新时间:2023-11-04 12:26:31 25 4
gpt4 key购买 nike

我正在尝试在 IFC6410 linux 平台上使用 google-assistant SDK。但是我在下面的命令中收到 SSL: CERTIFICATE_VERIFY_FAILED 错误。

google-oauthlib-tool --client-secrets /home/linaro/client_secret_612531194297-arb9dts0sfc6i379n3jk2mvh275qoi57.apps.googleusercontent.com.json --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless

错误日志:输入授权码后

Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.4/dist-packages/urllib3/connectionpool.py", line 345, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.4/dist-packages/urllib3/connectionpool.py", line 844, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.4/dist-packages/urllib3/connection.py", line 326, in connect
ssl_context=context)
File "/usr/local/lib/python3.4/dist-packages/urllib3/util/ssl_.py", line 325, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.4/ssl.py", line 364, in wrap_socket
_context=self)
File "/usr/lib/python3.4/ssl.py", line 578, in __init__
self.do_handshake()
File "/usr/lib/python3.4/ssl.py", line 805, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 440, in send
timeout=timeout
File "/usr/local/lib/python3.4/dist-packages/urllib3/connectionpool.py", line 630, in urlopen
raise SSLError(e)
urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/google-oauthlib-tool", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/google_auth_oauthlib/tool/__main__.py", line 106, in main
creds = flow.run_console()
File "/usr/local/lib/python3.4/dist-packages/google_auth_oauthlib/flow.py", line 358, in run_console
self.fetch_token(code=code)
File "/usr/local/lib/python3.4/dist-packages/google_auth_oauthlib/flow.py", line 235, in fetch_token
**kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests_oauthlib/oauth2_session.py", line 221, in fetch_token
verify=verify, proxies=proxies)
File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 560, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests_oauthlib/oauth2_session.py", line 360, in request
headers=headers, data=data, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 513, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 623, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)

请让我知道是 python 还是 openssl 有什么问题。

最佳答案

我找到了解决方案

使用这个命令:

sudo pip install certifi==2015.04.28

:-)

关于linux - Google Assistant 获取 SSL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44426844/

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