home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.75k stars 30k forks source link

Freebox - certificate verify failed: unable to get local issuer certificate #83715

Closed Inervo closed 1 year ago

Inervo commented 1 year ago

The problem

Hi,

Since some days ago, the Freebox integration suddenly stopped working, and I get the attached error in the log:

Is it something common, or me only? How can I fix it?

What version of Home Assistant Core has the issue?

core-2022.12.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Freebox

Link to integration documentation on our website

https://www.home-assistant.io/integrations/freebox

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.freebox.config_flow
Source: components/freebox/config_flow.py:75
Integration: Freebox (documentation, issues)
First occurred: 13:54:28 (7 occurrences)
Last logged: 14:03:48

Unknown error connecting with Freebox router at y3bef8so.fbxos.fr
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1089, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1119, in _create_connection_transport
    await waiter
  File "/usr/local/lib/python3.10/asyncio/sslproto.py", line 534, in data_received
    ssldata, appdata = self._sslpipe.feed_ssldata(data)
  File "/usr/local/lib/python3.10/asyncio/sslproto.py", line 188, in feed_ssldata
    self._sslobj.do_handshake()
  File "/usr/local/lib/python3.10/ssl.py", line 975, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/freebox/config_flow.py", line 75, in async_step_link
    await fbx.open(self._host, self._port)
  File "/usr/local/lib/python3.10/site-packages/freebox_api/aiofreepybox.py", line 83, in open
    self._access = await self._get_freebox_access(
  File "/usr/local/lib/python3.10/site-packages/freebox_api/aiofreepybox.py", line 162, in _get_freebox_access
    app_token, track_id = await self._get_app_token(base_url, app_desc, timeout)
  File "/usr/local/lib/python3.10/site-packages/freebox_api/aiofreepybox.py", line 226, in _get_app_token
    r = await self._session.post(url, data=data, timeout=timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 536, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 982, in _wrap_create_connection
    raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host y3bef8so.fbxos.fr:63132 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')]

Additional information

Using Freebox V8 also known as Freebox Pop

Running on latest docker container.

home-assistant[bot] commented 1 year ago

Hey there @hacf-fr, @quentame, mind taking a look at this issue as it has been labeled with an integration (freebox) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `freebox` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign freebox` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


freebox documentation freebox source (message by IssueLinks)

Inervo commented 1 year ago

It seems the error is in the personalized domain registered on the freebox itself.

Without this domain, it works.