|
发表于 2024-10-16 18:48:05
|
显示全部楼层
本帖最后由 Cunlixie 于 2024-10-16 18:52 编辑
添加集成,填入自己申请的api密钥,报:已保存配置,无需二次;
查看日志:
日志记录器: custom_components.zhipuai.const
来源: custom_components/zhipuai/config_flow.py:105
集成: 智谱清言 (文档, 问题)
首次出现: 13:08:57 (4 次总计出现)
上次记录: 18:43:10
发生意外异常: 无法连接到智谱AI API: Cannot connect to host open.bigmodel.cn:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')]
Traceback (most recent call last):
File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/connector.py", line 1068, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs, sock=sock)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/python-3.12.3/lib/python3.12/asyncio/base_events.py", line 1149, in create_connection
transport, protocol = await self._create_connection_transport(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/python-3.12.3/lib/python3.12/asyncio/base_events.py", line 1182, in _create_connection_transport
await waiter
File "/usr/local/python-3.12.3/lib/python3.12/asyncio/sslproto.py", line 578, in _on_handshake_complete
raise handshake_exc
File "/usr/local/python-3.12.3/lib/python3.12/asyncio/sslproto.py", line 560, in _do_handshake
self._sslobj.do_handshake()
File "/usr/local/python-3.12.3/lib/python3.12/ssl.py", line 917, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/.homeassistant/custom_components/zhipuai/config_flow.py", line 140, in _validate_api_key
async with session.post(url, headers=headers, json=data) as response:
File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/client.py", line 1355, in __aenter__
self._resp: _RetType = await self._coro
^^^^^^^^^^^^^^^^
File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/client.py", line 659, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/connector.py", line 557, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/connector.py", line 1002, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/connector.py", line 1336, in _create_direct_connection
raise last_exc
File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/connector.py", line 1305, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/connector.py", line 1070, in _wrap_create_connection
raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host open.bigmodel.cn:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/.homeassistant/custom_components/zhipuai/config_flow.py", line 105, in async_step_user
await self._validate_api_key(user_input[CONF_API_KEY])
File "/root/.homeassistant/custom_components/zhipuai/config_flow.py", line 154, in _validate_api_key
raise InvalidAPIKey(f"无法连接到智谱AI API: {str(e)}")
custom_components.zhipuai.config_flow.InvalidAPIKey: 无法连接到智谱AI API: Cannot connect to host open.bigmodel.cn:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')]
请问错误如何解决?HA core 2024.10.2
python 3.12 venv
|
|