Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Certificate issues with aiohttp #18

Open
s00500 opened this issue Oct 13, 2023 · 6 comments · May be fixed by #55
Open

Certificate issues with aiohttp #18

s00500 opened this issue Oct 13, 2023 · 6 comments · May be fixed by #55

Comments

@s00500
Copy link

s00500 commented Oct 13, 2023

Hey all,
I am using a selfsigned certificate on my homeassistant install.

After installing the satelite on a different Pi I still get
ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')]

(Something in the likes of what is described here https://raspberrypi.stackexchange.com/questions/76419/entrusted-certificates-installation)

To try to fix then I pretty much took my CA cert and did trust it using the systems ca-certificate config... but that did not change anything for aiohttp unfortunatly...

Any pointers ?

@s00500
Copy link
Author

s00500 commented Oct 13, 2023

Interestingly after I started to use my actual hostname (the one used in the certificate) I can get it to give a different error:

aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host homeserver.bachi:8123 ssl:default [Network is unreachable]

Also strange, as I can ping it fine using that hostname. Also I am using this server and its self signed cert fine on my IOS devices (with the root cert installed there)

@synesthesiam
Copy link
Owner

It looks like we would need to extend it like this: https://docs.aiohttp.org/en/stable/client_advanced.html#ssl-control-for-tcp-sockets

@s00500
Copy link
Author

s00500 commented Oct 13, 2023

Hm another option for a cert? Or one for skip verify?

@synesthesiam
Copy link
Owner

Probably skip verification to start.

@gigawebs
Copy link

My temporary solution for this issue was by changing line 27 in /homeassistant-satellite/homeassistant_satellite/remote.py

from
async with aiohttp.ClientSession() as session:

to

async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False)) as session:

@s00500 s00500 linked a pull request Oct 30, 2023 that will close this issue
@s00500
Copy link
Author

s00500 commented Oct 30, 2023

Nice, I added a PR

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

Successfully merging a pull request may close this issue.

3 participants