Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL: CERTIFICATE_VERIFY_FAILED: certificate verify failed: self-signed certificate #13

Closed
eeeeb opened this issue Feb 18, 2024 · 3 comments

Comments

@eeeeb
Copy link

eeeeb commented Feb 18, 2024

Hello,

after installing version 0.3.4 the the issue mentioned in #10 is fixed, but now I get the following error, when configuring to use SSL.
I don't think there is a way to use anything besides a self signed certificate in the Speedport Smart 4, right?

Logger: homeassistant.config_entries
Source: config_entries.py:444
First occurred: 10:56:05 (1 occurrences)
Last logged: 10:56:05

Error setting up entry Speedport for speedport
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1146, in create_connection
    transport, protocol = await self._create_connection_transport(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1179, in _create_connection_transport
    await waiter
  File "/usr/local/lib/python3.12/asyncio/sslproto.py", line 575, in _on_handshake_complete
    raise handshake_exc
  File "/usr/local/lib/python3.12/asyncio/sslproto.py", line 557, in _do_handshake
    self._sslobj.do_handshake()
  File "/usr/local/lib/python3.12/ssl.py", line 917, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1000)

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/speedport/__init__.py", line 27, in async_setup_entry
    speedport = await Speedport(
                ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/speedport/speedport.py", line 60, in create
    await self.update_status()
  File "/usr/local/lib/python3.12/site-packages/speedport/speedport.py", line 118, in update_status
    self._status = await self.api.get_status()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/speedport/api.py", line 116, in get_status
    return await self.api.get("data/Status.json")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/speedport/connection.py", line 94, in get
    async with self._session.get(url, headers={"Referer": referer}) as response:
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1194, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 578, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 544, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 911, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1235, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1204, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 994, in _wrap_create_connection
    raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host 10.10.1.1:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1000)')]

I am using:
Speedport Smart 4 Typ A - Firmware version: 010139.3.4.001.1
Speedport integration: 0.3.4
Home Assistant

  • Core: 2024.2.2
  • Supervisor: 2024.01.1
  • Operating System: 11.5
  • Frontend: 20240207.1
Andre0512 added a commit to Andre0512/speedport-api that referenced this issue Feb 18, 2024
@Andre0512
Copy link
Owner

Hi, thanks for reporting! Should be fixed in the new version 🙂

@eeeeb
Copy link
Author

eeeeb commented Feb 18, 2024

Thank you for fixing it so quickly!

@BreitiDE
Copy link

thank you for fixing … works perfectly now …

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants