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 unable to get local issuer certificate #285

Open
mwPandoraid opened this issue Feb 6, 2025 · 67 comments
Open

SSL unable to get local issuer certificate #285

mwPandoraid opened this issue Feb 6, 2025 · 67 comments
Assignees
Labels
bug Something isn't working

Comments

@mwPandoraid
Copy link

When i attempt to use pyhOn or the HACS integration, i receive the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/dist-packages/aiohttp/connector.py", line 1122, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs, sock=sock)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/base_events.py", line 1149, in create_connection
    transport, protocol = await self._create_connection_transport(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/base_events.py", line 1182, in _create_connection_transport
    await waiter
  File "/usr/lib/python3.12/asyncio/sslproto.py", line 578, in _on_handshake_complete
    raise handshake_exc
  File "/usr/lib/python3.12/asyncio/sslproto.py", line 560, in _do_handshake
    self._sslobj.do_handshake()
  File "/usr/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 "/usr/local/bin/pyhOn", line 8, in <module>
    sys.exit(start())
             ^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/pyhon/__main__.py", line 107, in start
    asyncio.run(main())
  File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/pyhon/__main__.py", line 75, in main
    async with Hon(*get_login_data(args), test_data_path=test_data_path) as hon:
  File "/usr/local/lib/python3.12/dist-packages/pyhon/hon.py", line 41, in __aenter__
    return await self.create()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/pyhon/hon.py", line 77, in create
    await self.setup()
  File "/usr/local/lib/python3.12/dist-packages/pyhon/hon.py", line 104, in setup
    appliances = await self.api.load_appliances()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/api.py", line 86, in load_appliances
    async with self._hon.get(f"{const.API_URL}/commands/v1/appliance") as resp:
  File "/usr/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/handler/base.py", line 64, in get
    async with self._intercept(*args, **kwargs) as response:
  File "/usr/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/handler/hon.py", line 75, in _intercept
    kwargs["headers"] = await self._check_headers(kwargs.get("headers", {}))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/handler/hon.py", line 64, in _check_headers
    await self.auth.authenticate()
  File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/auth.py", line 261, in authenticate
    if not await self._load_login():
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/auth.py", line 104, in _load_login
    login_url = await self._introduce()
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/auth.py", line 120, in _introduce
    async with self._request.get(url) as response:
  File "/usr/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/handler/base.py", line 64, in get
    async with self._intercept(*args, **kwargs) as response:
  File "/usr/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/handler/auth.py", line 36, in _intercept
    async with method(url, *args, **kwargs) as response:
  File "/usr/local/lib/python3.12/dist-packages/aiohttp/client.py", line 1425, in __aenter__
    self._resp: _RetType = await self._coro
                           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/aiohttp/client.py", line 703, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/aiohttp/connector.py", line 548, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/aiohttp/connector.py", line 1056, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/aiohttp/connector.py", line 1400, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.12/dist-packages/aiohttp/connector.py", line 1369, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/aiohttp/connector.py", line 1124, in _wrap_create_connection
    raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host account2.hon-smarthome.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')]
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f57ed1047d0>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f57ed104800>

This happens both on my HomeAssistant host and on my local machine.

@mwPandoraid mwPandoraid added the bug Something isn't working label Feb 6, 2025
@mwPandoraid
Copy link
Author

fixed it on my side but leaving the issue open since this is not the intended process most likely
FIX:

  1. go to https://account2.hon-smarthome.com/
  2. export RapidSSL certificate
  3. import it, on ubuntu:
    • sudo mv rapidssl.crt /usr/local/share/ca-certificates/rapidssl.crt
    • sudo update-ca-certificates

after that it should work just fine

@mwPandoraid
Copy link
Author

seems to be an issue on haier's side though, it started today after 2am Europe/Warsaw timezone

@mwPandoraid
Copy link
Author

^ the above was insufficient for actual HA integration, i had to use this plugin: https://github.com/Athozs/hass-additional-ca

@danyrd92
Copy link

danyrd92 commented Feb 6, 2025

^ the above was insufficient for actual HA integration, i had to use this plugin: https://github.com/Athozs/hass-additional-ca

thanks!!

@jfmcarreira
Copy link

I can confirm that this fix works.

Just a note that the idea is to open the website and download the certificate from the browser. Took me a bit more than I am proud to say to find that out :)

@Jansmeister
Copy link

I tried the work around described but get this error setting up the additional_ca add-on:

Logger: homeassistant.setup
Bron: setup.py:416
Eerst voorgekomen: 17:25:54 (1 gebeurtenissen)
Laatst gelogd: 17:25:54

Error during setup of component additional_ca
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 416, in _async_setup_component
result = await task
^^^^^^^^^^
File "/config/custom_components/additional_ca/init.py", line 54, in async_setup
await update_certifi_certificates(hass, config)
File "/config/custom_components/additional_ca/init.py", line 170, in update_certifi_certificates
cert = await f.read()
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiofiles/threadpool/utils.py", line 43, in method
return await self._loop.run_in_executor(self._executor, cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "", line 325, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 1: invalid start byte

@mwPandoraid
Copy link
Author

I tried the work around described but get this error setting up the additional_ca add-on:

Logger: homeassistant.setup Bron: setup.py:416 Eerst voorgekomen: 17:25:54 (1 gebeurtenissen) Laatst gelogd: 17:25:54

Error during setup of component additional_ca Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 416, in _async_setup_component result = await task ^^^^^^^^^^ File "/config/custom_components/additional_ca/init.py", line 54, in async_setup await update_certifi_certificates(hass, config) File "/config/custom_components/additional_ca/init.py", line 170, in update_certifi_certificates cert = await f.read() ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiofiles/threadpool/utils.py", line 43, in method return await self._loop.run_in_executor(self._executor, cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run result = self.fn(*self.args, **self.kwargs) File "", line 325, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 1: invalid start byte

Can you show me the contents of the certificate you exported? In text form (for example open in notepad or just use cat), it should look something like this:

-----BEGIN CERTIFICATE-----
MIIEszCCA5ugAwIBAgIQCyWUIs7ZgSoVoE6ZUooO+jANBgkqhkiG9w0BAQsFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
MjAeFw0xNzExMDIxMjI0MzNaFw0yNzExMDIxMjI0MzNaMGA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m
SlbmE50UYBHXM0SKXPqHMzk6XQUpCheF/4qU8aOhajsyRQFDV1ih/uPIg7YHRtFi
CTq4G+zb43X1T77nJgSOI9pq/TqCwtukZ7u9VLL3JAq3Wdy2moKLvvC8tVmRzkAe
0xQCkRKIjbBG80MSyDX/R4uYgj6ZiNT/Zg6GI6RofgqgpDdssLc0XIRQEotxIZcK
zP3pGJ9FCbMHmMLLyuBd+uCWvVcF2ogYAawufChS/PT61D9rqzPRS5I2uqa3tmIT
44JhJgWhBnFMb7AGQkvNq9KNS9dd3GWc17H/dXa1enoxzWjE0hBdFjxPhUb0W3wi
8o34/m8Fxw==
-----END CERTIFICATE-----

@Jansmeister
Copy link

I tried the work around described but get this error setting up the additional_ca add-on:
Logger: homeassistant.setup Bron: setup.py:416 Eerst voorgekomen: 17:25:54 (1 gebeurtenissen) Laatst gelogd: 17:25:54
Error during setup of component additional_ca Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 416, in _async_setup_component result = await task ^^^^^^^^^^ File "/config/custom_components/additional_ca/init.py", line 54, in async_setup await update_certifi_certificates(hass, config) File "/config/custom_components/additional_ca/init.py", line 170, in update_certifi_certificates cert = await f.read() ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiofiles/threadpool/utils.py", line 43, in method return await self._loop.run_in_executor(self._executor, cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run result = self.fn(*self.args, **self.kwargs) File "", line 325, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 1: invalid start byte

Can you show me the contents of the certificate you exported? In text form (for example open in notepad or just use cat), it should look something like this:

-----BEGIN CERTIFICATE-----
MIIEszCCA5ugAwIBAgIQCyWUIs7ZgSoVoE6ZUooO+jANBgkqhkiG9w0BAQsFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMR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QcCARYcaHR0cHM6Ly93d3cuZGlnaWNlcnQuY29tL0NQUzALBglghkgBhv1sAQIw
CAYGZ4EMAQIBMAgGBmeBDAECAjANBgkqhkiG9w0BAQsFAAOCAQEAGUSlOb4K3Wtm
SlbmE50UYBHXM0SKXPqHMzk6XQUpCheF/4qU8aOhajsyRQFDV1ih/uPIg7YHRtFi
CTq4G+zb43X1T77nJgSOI9pq/TqCwtukZ7u9VLL3JAq3Wdy2moKLvvC8tVmRzkAe
0xQCkRKIjbBG80MSyDX/R4uYgj6ZiNT/Zg6GI6RofgqgpDdssLc0XIRQEotxIZcK
zP3pGJ9FCbMHmMLLyuBd+uCWvVcF2ogYAawufChS/PT61D9rqzPRS5I2uqa3tmIT
44JhJgWhBnFMb7AGQkvNq9KNS9dd3GWc17H/dXa1enoxzWjE0hBdFjxPhUb0W3wi
8o34/m8Fxw==
-----END CERTIFICATE-----

My certificate looks like this. The problem described is with de add-on from HACS. When I download the add-on in HACS and restart HA I get this error in HA. This is before I even add the certificate in my config.

@mwPandoraid
Copy link
Author

I tried the work around described but get this error setting up the additional_ca add-on:
Logger: homeassistant.setup Bron: setup.py:416 Eerst voorgekomen: 17:25:54 (1 gebeurtenissen) Laatst gelogd: 17:25:54
Error during setup of component additional_ca Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 416, in _async_setup_component result = await task ^^^^^^^^^^ File "/config/custom_components/additional_ca/init.py", line 54, in async_setup await update_certifi_certificates(hass, config) File "/config/custom_components/additional_ca/init.py", line 170, in update_certifi_certificates cert = await f.read() ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiofiles/threadpool/utils.py", line 43, in method return await self._loop.run_in_executor(self._executor, cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run result = self.fn(*self.args, **self.kwargs) File "", line 325, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 1: invalid start byte

Can you show me the contents of the certificate you exported? In text form (for example open in notepad or just use cat), it should look something like this:

-----BEGIN CERTIFICATE-----
MIIEszCCA5ugAwIBAgIQCyWUIs7ZgSoVoE6ZUooO+jANBgkqhkiG9w0BAQsFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
MjAeFw0xNzExMDIxMjI0MzNaFw0yNzExMDIxMjI0MzNaMGAxCzAJBgNVBAYTAlVT
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
b20xHzAdBgNVBAMTFlJhcGlkU1NMIFRMUyBSU0EgQ0EgRzEwggEiMA0GCSqGSIb3
DQEBAQUAA4IBDwAwggEKAoIBAQC/uVklRBI1FuJdUEkFCuDL/I3aJQiaZ6aibRHj
ap/ap9zy1aYNrphe7YcaNwMoPsZvXDR+hNJOo9gbgOYVTPq8gXc84I75YKOHiVA4
NrJJQZ6p2sJQyqx60HkEIjzIN+1LQLfXTlpuznToOa1hyTD0yyitFyOYwURM+/CI
8FNFMpBhw22hpeAQkOOLmsqT5QZJYeik7qlvn8gfD+XdDnk3kkuuu0eG+vuyrSGr
5uX5LRhFWlv1zFQDch/EKmd163m6z/ycx/qLa9zyvILc7cQpb+k7TLra9WE17YPS
n9ANjG+ECo9PDW3N9lwhKQCNvw1gGoguyCQu7HE7BnW8eSSFAgMBAAGjggFmMIIB
YjAdBgNVHQ4EFgQUDNtsgkkPSmcKuBTuesRIUojrVjgwHwYDVR0jBBgwFoAUTiJU
IBiV5uNu5g/6+rkS7QYXjzkwDgYDVR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQGCCsG
AQUFBwMBBggrBgEFBQcDAjASBgNVHRMBAf8ECDAGAQH/AgEAMDQGCCsGAQUFBwEB
BCgwJjAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29tMEIGA1Ud
HwQ7MDkwN6A1oDOGMWh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEds
b2JhbFJvb3RHMi5jcmwwYwYDVR0gBFwwWjA3BglghkgBhv1sAQEwKjAoBggrBgEF
BQcCARYcaHR0cHM6Ly93d3cuZGlnaWNlcnQuY29tL0NQUzALBglghkgBhv1sAQIw
CAYGZ4EMAQIBMAgGBmeBDAECAjANBgkqhkiG9w0BAQsFAAOCAQEAGUSlOb4K3Wtm
SlbmE50UYBHXM0SKXPqHMzk6XQUpCheF/4qU8aOhajsyRQFDV1ih/uPIg7YHRtFi
CTq4G+zb43X1T77nJgSOI9pq/TqCwtukZ7u9VLL3JAq3Wdy2moKLvvC8tVmRzkAe
0xQCkRKIjbBG80MSyDX/R4uYgj6ZiNT/Zg6GI6RofgqgpDdssLc0XIRQEotxIZcK
zP3pGJ9FCbMHmMLLyuBd+uCWvVcF2ogYAawufChS/PT61D9rqzPRS5I2uqa3tmIT
44JhJgWhBnFMb7AGQkvNq9KNS9dd3GWc17H/dXa1enoxzWjE0hBdFjxPhUb0W3wi
8o34/m8Fxw==
-----END CERTIFICATE-----

My certificate looks like this. The problem described is with de add-on from HACS. When I download the add-on in HACS and restart HA I get this error in HA. This is before I even add the certificate in my config.

My bad, could you send the configuration.yaml file? The error suggest that it's trying to read the certificate file, but it's somehow malformed. Might be a bad path, or the certificate itself

@mwPandoraid
Copy link
Author

Considering this is before adding the certificate, maybe try adding it to see if it works?

@FredoElmo
Copy link

FredoElmo commented Feb 6, 2025

I tried the work around described but get this error setting up the additional_ca add-on:
Logger: homeassistant.setup Bron: setup.py:416 Eerst voorgekomen: 17:25:54 (1 gebeurtenissen) Laatst gelogd: 17:25:54
Error during setup of component additional_ca Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 416, in _async_setup_component result = await task ^^^^^^^^^^ File "/config/custom_components/additional_ca/init.py", line 54, in async_setup await update_certifi_certificates(hass, config) File "/config/custom_components/additional_ca/init.py", line 170, in update_certifi_certificates cert = await f.read() ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiofiles/threadpool/utils.py", line 43, in method return await self._loop.run_in_executor(self._executor, cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run result = self.fn(*self.args, **self.kwargs) File "", line 325, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 1: invalid start byte

Can you show me the contents of the certificate you exported? In text form (for example open in notepad or just use cat), it should look something like this:

-----BEGIN CERTIFICATE-----
MIIEszCCA5ugAwIBAgIQCyWUIs7ZgSoVoE6ZUooO+jANBgkqhkiG9w0BAQsFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
MjAeFw0xNzExMDIxMjI0MzNaFw0yNzExMDIxMjI0MzNaMGAxCzAJBgNVBAYTAlVT
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
b20xHzAdBgNVBAMTFlJhcGlkU1NMIFRMUyBSU0EgQ0EgRzEwggEiMA0GCSqGSIb3
DQEBAQUAA4IBDwAwggEKAoIBAQC/uVklRBI1FuJdUEkFCuDL/I3aJQiaZ6aibRHj
ap/ap9zy1aYNrphe7YcaNwMoPsZvXDR+hNJOo9gbgOYVTPq8gXc84I75YKOHiVA4
NrJJQZ6p2sJQyqx60HkEIjzIN+1LQLfXTlpuznToOa1hyTD0yyitFyOYwURM+/CI
8FNFMpBhw22hpeAQkOOLmsqT5QZJYeik7qlvn8gfD+XdDnk3kkuuu0eG+vuyrSGr
5uX5LRhFWlv1zFQDch/EKmd163m6z/ycx/qLa9zyvILc7cQpb+k7TLra9WE17YPS
n9ANjG+ECo9PDW3N9lwhKQCNvw1gGoguyCQu7HE7BnW8eSSFAgMBAAGjggFmMIIB
YjAdBgNVHQ4EFgQUDNtsgkkPSmcKuBTuesRIUojrVjgwHwYDVR0jBBgwFoAUTiJU
IBiV5uNu5g/6+rkS7QYXjzkwDgYDVR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQGCCsG
AQUFBwMBBggrBgEFBQcDAjASBgNVHRMBAf8ECDAGAQH/AgEAMDQGCCsGAQUFBwEB
BCgwJjAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29tMEIGA1Ud
HwQ7MDkwN6A1oDOGMWh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEds
b2JhbFJvb3RHMi5jcmwwYwYDVR0gBFwwWjA3BglghkgBhv1sAQEwKjAoBggrBgEF
BQcCARYcaHR0cHM6Ly93d3cuZGlnaWNlcnQuY29tL0NQUzALBglghkgBhv1sAQIw
CAYGZ4EMAQIBMAgGBmeBDAECAjANBgkqhkiG9w0BAQsFAAOCAQEAGUSlOb4K3Wtm
SlbmE50UYBHXM0SKXPqHMzk6XQUpCheF/4qU8aOhajsyRQFDV1ih/uPIg7YHRtFi
CTq4G+zb43X1T77nJgSOI9pq/TqCwtukZ7u9VLL3JAq3Wdy2moKLvvC8tVmRzkAe
0xQCkRKIjbBG80MSyDX/R4uYgj6ZiNT/Zg6GI6RofgqgpDdssLc0XIRQEotxIZcK
zP3pGJ9FCbMHmMLLyuBd+uCWvVcF2ogYAawufChS/PT61D9rqzPRS5I2uqa3tmIT
44JhJgWhBnFMb7AGQkvNq9KNS9dd3GWc17H/dXa1enoxzWjE0hBdFjxPhUb0W3wi
8o34/m8Fxw==
-----END CERTIFICATE-----

My certificate looks like this. The problem described is with de add-on from HACS. When I download the add-on in HACS and restart HA I get this error in HA. This is before I even add the certificate in my config.

Did you add something like:

default_config:
additional_ca:
  hon: hon_rapidssl.crt

into your configuration.yaml after you added your .crt-file in the new created folder config\additional_ca\ in your HA?

@Jansmeister
Copy link

I tried the work around described but get this error setting up the additional_ca add-on:
Logger: homeassistant.setup Bron: setup.py:416 Eerst voorgekomen: 17:25:54 (1 gebeurtenissen) Laatst gelogd: 17:25:54
Error during setup of component additional_ca Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 416, in _async_setup_component result = await task ^^^^^^^^^^ File "/config/custom_components/additional_ca/init.py", line 54, in async_setup await update_certifi_certificates(hass, config) File "/config/custom_components/additional_ca/init.py", line 170, in update_certifi_certificates cert = await f.read() ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiofiles/threadpool/utils.py", line 43, in method return await self._loop.run_in_executor(self._executor, cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run result = self.fn(*self.args, **self.kwargs) File "", line 325, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 1: invalid start byte

Can you show me the contents of the certificate you exported? In text form (for example open in notepad or just use cat), it should look something like this:

-----BEGIN CERTIFICATE-----
MIIEszCCA5ugAwIBAgIQCyWUIs7ZgSoVoE6ZUooO+jANBgkqhkiG9w0BAQsFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
MjAeFw0xNzExMDIxMjI0MzNaFw0yNzExMDIxMjI0MzNaMGAxCzAJBgNVBAYTAlVT
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
b20xHzAdBgNVBAMTFlJhcGlkU1NMIFRMUyBSU0EgQ0EgRzEwggEiMA0GCSqGSIb3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/R4uYgj6ZiNT/Zg6GI6RofgqgpDdssLc0XIRQEotxIZcK
zP3pGJ9FCbMHmMLLyuBd+uCWvVcF2ogYAawufChS/PT61D9rqzPRS5I2uqa3tmIT
44JhJgWhBnFMb7AGQkvNq9KNS9dd3GWc17H/dXa1enoxzWjE0hBdFjxPhUb0W3wi
8o34/m8Fxw==
-----END CERTIFICATE-----

My certificate looks like this. The problem described is with de add-on from HACS. When I download the add-on in HACS and restart HA I get this error in HA. This is before I even add the certificate in my config.

Did you add something like:

default_config:
additional_ca:
  hon: hon_rapidssl.crt

into your configuration.yaml after you added your .crt-file in the new created folder config\additional_ca\ in your HA?

Yes I did.

@mwPandoraid
Copy link
Author

I think the only reasonable explanation is that the exported certificate is somehow malformed. It cannot be an issue solely with the plugin, because the part that throws an exception is the part that actually attempts to read the certificate specified in the configuration, and it points towards there being a character it cannot read.
Can you try exporting the certificate again?
And again, if you could send your config, it might be helpful.

@Jansmeister
Copy link

I think the only reasonable explanation is that the exported certificate is somehow malformed. It cannot be an issue solely with the plugin, because the part that throws an exception is the part that actually attempts to read the certificate specified in the configuration, and it points towards there being a character it cannot read. Can you try exporting the certificate again? And again, if you could send your config, it might be helpful.

I got the additional_ca add-on working now. Implemented the certificate but the haier integration still doesn't setup. It's still the same SSL error in the logs

@mwPandoraid
Copy link
Author

I think it's because you actually need both the RapidSSL certificate and the DigiCert certificate. It worked with RapidSSL only for me when i set it up the first time, but i reset my setup to test something and I had to import both certificates.

@Jansmeister
Copy link

I think it's because you actually need both the RapidSSL certificate and the DigiCert certificate. It worked with RapidSSL only for me when i set it up the first time, but i reset my setup to test something and I had to import both certificates.

Owke we'll finally get there I hope.....
How do I download and setup both certificates.

On a roll now and learning stuff so give it to me :)

@jm314159
Copy link

jm314159 commented Feb 6, 2025

Guys, I managed to have hon working. I described steps I followed here: #286 in detail. If you could give it a try...

@mwPandoraid
Copy link
Author

I think it's because you actually need both the RapidSSL certificate and the DigiCert certificate. It worked with RapidSSL only for me when i set it up the first time, but i reset my setup to test something and I had to import both certificates.

Owke we'll finally get there I hope..... How do I download and setup both certificates.

On a roll now and learning stuff so give it to me :)

The steps @jm314159 described sound pretty much exactly right, I just didn't have to remove hOn integration at all.

Image

Here you just click on DigiCert, press export, and then repeat the same process for RapidSSL

@Jansmeister
Copy link

I think it's because you actually need both the RapidSSL certificate and the DigiCert certificate. It worked with RapidSSL only for me when i set it up the first time, but i reset my setup to test something and I had to import both certificates.

Owke we'll finally get there I hope..... How do I download and setup both certificates.
On a roll now and learning stuff so give it to me :)

The steps @jm314159 described sound pretty much exactly right, I just didn't have to remove hOn integration at all.

Image

Here you just click on DigiCert, press export, and then repeat the same process for RapidSSL

Hell yeah! It works.....finally. Thanks for all the help, feel like a complete noob overhere :(

@bartwr
Copy link

bartwr commented Feb 6, 2025

Thank you all.

I too had the issue that the hOn addon for Home Assistant didn't work anymore since February 6th 2025. The solution mentioned in the comment thread above did fix the issue.

For full reference I share what I did:

Installing Additional CA

  1. Using HACS I installed Additional CA, as suggested here

Downloading hOn certificate

  1. Using Firefox I navigated to https://account2.hon-smarthome.com/
  2. Left to the Firefox address bar I clicked the lock icon and then Connection secure and then More information
    Image
  3. In the popup I clicked the View Certificate button and clicked the second "RapidSSL TLS RSA CA G1" tab

    Image
  4. Nearby the 'Miscellaneous' heading, I clicked the PEM (cert) tab to download the certificate as a .pem file to my computer

Converting .pem to .crt

  1. On my Linux computer I opened a terminal, navigated to the folder that contained the download .pem file and executed the command openssl x509 -outform PEM -in account2-hon-smarthome-com.pem -out account2-hon-smarthome-com.crt like mentioned here

Saving .crt file on Home Assistant hard disk

  1. I opened Home Assistant in my web browser and opened my file browser (i.e. "Visual Code Server" or "File editor")
  2. I created the folder /config/additional_ca like mentioned here
  3. I drag&dropped the file account2-hon-smarthome-com.crt from my computer folder to the newly created Home Assistant folder config/additional_ca

    Image

Updating configuration.yaml

  1. Using a Home Assistant file editor, I opened configuration.yaml and added this to the bottom of the file:
additional_ca:
  my_private_ca: account2-hon-smarthome-com.crt
  1. I saved configuration.yaml and restarted Home Assistant

Now the hOn addon worked again.

@Jansmeister
Copy link

Jansmeister commented Feb 6, 2025

Still the same issue with the off switch remains. Anyone have a solution for that annoyance?

Image

@mwPandoraid
Copy link
Author

mwPandoraid commented Feb 6, 2025

Still the same issue with the off switch remains. Anyone have a solution for that annoyance?

Image

There's a fix for that here: https://github.com/Andre0512/hon/pull/277/files
I'm not really too sure how to change the branch of an integration, so a quick and somewhat easy way would be to go to custom_components/hon/climate.py line 202 and replace self._device.sync_command("stopProgram", "settings") with self._device.settings["settings.onOffStatus"].value = "0", then restart HomeAssistant

like so:

Image

@Jansmeister
Copy link

Still the same issue with the off switch remains. Anyone have a solution for that annoyance?
Image

There's a fix for that here: https://github.com/Andre0512/hon/pull/277/files I'm not really too sure how to change the branch of an integration, so a quick and somewhat easy way would be to go to custom_components/hon/climate.py line 202 and replace self._device.sync_command("stopProgram", "settings") with self._device.settings["settings.onOffStatus"].value = "0", then restart HomeAssistant

like so:

Image

That did the trick, thanks!

@Jansmeister Jansmeister marked this as a duplicate of #286 Feb 6, 2025
@jfmcarreira
Copy link

@bartwr great explanation.

I will add up that I did not need to convert the .pem to .crt. Added it directly as you mention and it worked.

@indevor
Copy link

indevor commented Feb 6, 2025

Thank you all.

I too had the issue that the hOn addon for Home Assistant didn't work anymore since February 6th 2025. The solution mentioned in the comment thread above did fix the issue.

It worked for me. I saved the certificates from GoogleChrome (windows), renamed them and transferred them. Config:

additional_ca:                    
  RapidSSL: RapidSSL.crt                 
  DigiCert: DigiCertGlobalRootG2.crt

@indevor
Copy link

indevor commented Feb 7, 2025

May I ask wich version of HAOS and HA you are using?

I use:

Core 2025.1.4 Supervisor 2025.02.0 Operating System 14.2

Also in the logs I find no evidence that the addon is loaded.... I hate my life : '(

Core 2025.2.0
Supervisor 2025.02.0
Operating System 14.2
UI 20250205.0

delete the additional_ca folder and try again.

Download and install manually

Click button to download ZIP of Additional CA Release version
Unzip archive
Move folder additional_ca into config/custom_components/ directory
Installation done, now see Configuration section (README.md)
2.2. HAOS - Home Assistant Operating System
If you're running Home Assistant from HAOS:

Go to the Add-on store
Install one of the SSH add-ons (you need to enable advanced mode in your user profile to see them)
Configure the SSH add-on you chose by following the documentation for it
Start the SSH add-on
Connect to the SSH add-on
Download the latest release of Additional CA from Github (.zip):
wget https://github.com/Athozs/hass-additional-ca/releases/latest/download/additional_ca.zip
Unzip archive:
unzip additional_ca.zip
Move or copy folder additional_ca into config/custom_components/ directory:

mkdir -p config/custom_components
cp -r additional_ca config/custom_components/

don't forget to reboot the OS

@jm314159
Copy link

jm314159 commented Feb 7, 2025

Let's confirm those things.
Since you installed Additional CA add-on, you should see it in Settings > Devices & services > Integrations. Do you have it in there? Image

No it is not listed in my integrations, so something is going wrong with adding the intergration.

I only meant the add-on itself. For now, Additional CA cannot be configured from UI dashboard. This may be possible in future release.

Core 2025.2.0
Supervisor 2025.02.0
Operating System 14.2
Frontend 20250205.0

@droeloe1818
Copy link

May I ask wich version of HAOS and HA you are using?
I use:
Core 2025.1.4 Supervisor 2025.02.0 Operating System 14.2
Also in the logs I find no evidence that the addon is loaded.... I hate my life : '(

Core 2025.2.0 Supervisor 2025.02.0 Operating System 14.2 UI 20250205.0

delete the additional_ca folder and try again.

Download and install manually

Click button to download ZIP of Additional CA Release version Unzip archive Move folder additional_ca into config/custom_components/ directory Installation done, now see Configuration section (README.md) 2.2. HAOS - Home Assistant Operating System If you're running Home Assistant from HAOS:

Go to the Add-on store Install one of the SSH add-ons (you need to enable advanced mode in your user profile to see them) Configure the SSH add-on you chose by following the documentation for it Start the SSH add-on Connect to the SSH add-on Download the latest release of Additional CA from Github (.zip): wget https://github.com/Athozs/hass-additional-ca/releases/latest/download/additional_ca.zip Unzip archive: unzip additional_ca.zip Move or copy folder additional_ca into config/custom_components/ directory:

mkdir -p config/custom_components
cp -r additional_ca config/custom_components/

don't forget to reboot the OS

Thanks for your reply.

I exactly did these steps 3 times. and everyime the addon is listed when I click + Add integration but it is not listed in my configured intergrations.

# Loads default set of integrations. Do not remove.
default_config:

# Certificaat voor H0N, indien ooit verlopen nieuwe ophalen op https://account2.hon-smarthome.com en in additional_CA zetten             

additional_ca:                    
  RapidSSL: RapidSSL2.cer
  DigiCert: DigiCertGlobalRoot2.cer

There are no logs to be found of additional_ca (logger is set to default: info) according to documentation.

@droeloe1818
Copy link

Let's confirm those things.
Since you installed Additional CA add-on, you should see it in Settings > Devices & services > Integrations. Do you have it in there? Image

No it is not listed in my integrations, so something is going wrong with adding the intergration.

I only meant the add-on itself. For now, Additional CA cannot be configured from UI dashboard. This may be possible in future release.

Core 2025.2.0 Supervisor 2025.02.0 Operating System 14.2 Frontend 20250205.0

Image

It is realy not listed.

Image

config:

Image

@mwPandoraid
Copy link
Author

mwPandoraid commented Feb 7, 2025

by the way, if you're using HAOS you might be able to skip using the addon, and instead use this process:
#285 (comment)

have you tried it?
remember to import both certificates instead of only RapidSSL

@droeloe1818
Copy link

droeloe1818 commented Feb 7, 2025

by the way, if you're using HAOS you might be able to skip using the addon, and instead use this process: #285 (comment)

have you tried it? remember to import both certificates instead of only RapidSSL

Noob question incomming!

In the folder /usr/local/share/ there is no folder ca-certificates.

Can I create this folder or is there some stuff mussing I need to install first?

@jm314159
Copy link

jm314159 commented Feb 7, 2025

@mwPandoraid - I do not have such directory either, therefore I decided to use Additional CA.

@droeloe1818 - can you install Additional CA in Integrations after you have found it in the "Select brand" list?

@droeloe1818
Copy link

@mwPandoraid - I do not have such directory either, therefore I decided to use Additional CA.

@droeloe1818 - can you install Additional CA in Integrations after you have found it in the "Select brand" list?

nop

Image

@indevor
Copy link

indevor commented Feb 7, 2025

Let's confirm those things.
Since you installed Additional CA add-on, you should see it in Settings > Devices & services > Integrations. Do you have it in there? Image

No it is not listed in my integrations, so something is going wrong with adding the intergration.

I only meant the add-on itself. For now, Additional CA cannot be configured from UI dashboard. This may be possible in future release.
Core 2025.2.0 Supervisor 2025.02.0 Operating System 14.2 Frontend 20250205.0

Image

It is realy not listed.

Image

config:

Image

# Loads default set of integrations. Do not remove.
additional_ca:                    
  RapidSSL: RapidSSL.crt                 
  DigiCert: DigiCertGlobalRootG2.crt

you have an extension (the certificates themselves) cer

CA files must be in PEM format (often .crt or .pem extension). Check content with a text editor. Content example (following is a fake):

-----BEGIN CERTIFICATE-----
ACeuur4QnujqmguSrHU3mhf+cJodzTQNqo4tde+PD1/eFdYAELu8xF+0At7xJiPY
i5RKwilyP56v+3iY2T9lw7S8TJ041VLhaIKp14MzSUzRyeoOAsJ7QADMClHKUDlH
UU2pNuo88Y6igovT3bsnwJNiEQNqymSSYhktw0taduoqjqXn06gsVioWTVDXysd5
qEx4t6sIgIcMm26YH1vJpCQEhKpc2y07gRkklBZRtMjThv4cXyyMX7uTcdT7AJBP
ueifCoV25JxXuo8d5139gwP1BAe7IBVPx2u7KN/UyOXdZmwMf/TmFGwDdCfsyHf/
ZsB2wLHozTYoAVmQ9FoU1JLgcVivqJ+vNlBhHXhlxMdN0j80R9Nz6EIglQjeK3O8
I/cFGm/B8+42hOlCId9ZdtndJcRJVji0wD0qwevCafA9jJlHv/jsE+I9Uz6cpCyh
sw+lrFdxUgqU58axqeK89FR+No4q0IIO+Ji1rJKr9nkSB0BqXozVnE1YB/KLvdIs
uYZJuqb2pKku+zzT6gUwHUTZvBiNOtXL4Nxwc/KT7WzOSd2wP10QI8DKg4vfiNDs
HWmB1c4Kji6gOgA5uSUzaGmq/v4VncK5Ur+n9LbfnfLc28J5ft/GotinMyDk3iar
F10YlqcOmeX1uFmKbdi/XorGlkCoMF3TDx8rmp9DBiB/
-----END CERTIFICATE-----

I removed the “default_config:” line, it works without it.

@jm314159
Copy link

jm314159 commented Feb 7, 2025

@droeloe1818 - Could you please paste the result of ls /config/custom_components/additional_ca?

@droeloe1818
Copy link

@droeloe1818 - Could you please paste the result of ls /config/custom_components/additional_ca?

Image

@mwPandoraid
Copy link
Author

Could you upload your home-assistant.log file?

@droeloe1818
Copy link

Let's confirm those things.
Since you installed Additional CA add-on, you should see it in Settings > Devices & services > Integrations. Do you have it in there? Image

No it is not listed in my integrations, so something is going wrong with adding the intergration.

I only meant the add-on itself. For now, Additional CA cannot be configured from UI dashboard. This may be possible in future release.
Core 2025.2.0 Supervisor 2025.02.0 Operating System 14.2 Frontend 20250205.0

Image
It is realy not listed.
Image
config:
Image

# Loads default set of integrations. Do not remove.
additional_ca:                    
  RapidSSL: RapidSSL.crt                 
  DigiCert: DigiCertGlobalRootG2.crt

you have an extension (the certificates themselves) cer

CA files must be in PEM format (often .crt or .pem extension). Check content with a text editor. Content example (following is a fake):

-----BEGIN CERTIFICATE-----
ACeuur4QnujqmguSrHU3mhf+cJodzTQNqo4tde+PD1/eFdYAELu8xF+0At7xJiPY
i5RKwilyP56v+3iY2T9lw7S8TJ041VLhaIKp14MzSUzRyeoOAsJ7QADMClHKUDlH
UU2pNuo88Y6igovT3bsnwJNiEQNqymSSYhktw0taduoqjqXn06gsVioWTVDXysd5
qEx4t6sIgIcMm26YH1vJpCQEhKpc2y07gRkklBZRtMjThv4cXyyMX7uTcdT7AJBP
ueifCoV25JxXuo8d5139gwP1BAe7IBVPx2u7KN/UyOXdZmwMf/TmFGwDdCfsyHf/
ZsB2wLHozTYoAVmQ9FoU1JLgcVivqJ+vNlBhHXhlxMdN0j80R9Nz6EIglQjeK3O8
I/cFGm/B8+42hOlCId9ZdtndJcRJVji0wD0qwevCafA9jJlHv/jsE+I9Uz6cpCyh
sw+lrFdxUgqU58axqeK89FR+No4q0IIO+Ji1rJKr9nkSB0BqXozVnE1YB/KLvdIs
uYZJuqb2pKku+zzT6gUwHUTZvBiNOtXL4Nxwc/KT7WzOSd2wP10QI8DKg4vfiNDs
HWmB1c4Kji6gOgA5uSUzaGmq/v4VncK5Ur+n9LbfnfLc28J5ft/GotinMyDk3iar
F10YlqcOmeX1uFmKbdi/XorGlkCoMF3TDx8rmp9DBiB/
-----END CERTIFICATE-----

I removed the “default_config:” line, it works without it.

The CER certificates I placed where just for trouble shooting.

I put the original .crt certificates back.

here is the format:

Image

@jm314159
Copy link

jm314159 commented Feb 7, 2025

No pycache dir... Mmmm, should have the integration not started?
You obviously can remove .zip from there and restart Core once again.

That's my dir
Image

@droeloe1818
Copy link

Could you upload your home-assistant.log file?

Sure! thanks for helping!

home-assistant.log

@droeloe1818
Copy link

No pycache dir... Mmmm, should have the integration not started? You obviously can remove .zip from there and restart Core once again.

That's my dir Image

Removed the zip. Rebooted core.

Image

still not working.

@mwPandoraid
Copy link
Author

The only way I can replicate that behavior is if i remove all references to additional_ca from my configuration.yaml file. Can you try moving the additional_ca section to the top of the config? Also, it might be a long shot, but in the screenshot you posted for the configuration file, you had unsaved changes, so make sure you did save before restarting.

@droeloe1818
Copy link

feel completely ashamed writing this post, and I apologize to everyone who tried to help me – I wasted their time.

It turned out to be a saving issue with Studio Code, as @mwPandoraid suggested.

Now, I'm going to lie down under my desk for a while and reflect on my mistake

SORRY!!!!!!

It is all working now.

Do the certificates renew them self or do I need to do this X amount of time?

@LethalRabbit
Copy link

Following this thread as well. I am also curious if manual intervention is needed or whether this issue will 'fix' itself with a little patience? Does the renewed certificate find its way onto my system automatically at some point or will it be an anual manual exercise to put it on my system (considering the certificate validity is 1 year) ?

@NoUsername10
Copy link

NoUsername10 commented Feb 7, 2025

Hello everyone.
I am also stuck however on a different step.

I have both certificates but get this error during startup, perhaps someone could assist here?

Assist instructions: "Explain the solution to me like im 5 years old"

2025-02-07 18:03:59.962 WARNING (MainThread) [custom_components.additional_ca.utils] 'update-ca-certificates' returned an error -> WARNING: Skipping duplicate certificate in file ca-cert-DigiCert_Global_Root_G2.pem

Solution:

The folder: /config/additional_ca does not work as mentioned above.

Must use folder: /config/custom_components/additional_ca

@Do4bled
Copy link

Do4bled commented Feb 7, 2025

I had the same warning and searched for the filename but could not find it. check if you see any entries in the log stating changing password. I found out that the login succeeded with the new certificates but it redirected me to the change password page. It looks like that Hon requires you to change your password every year. After I logged on in the web environment where I got the certificates from and changed the password everything worked again with HA.

@gio-dzilla
Copy link

I can confirm that this fix works.

Just a note that the idea is to open the website and download the certificate from the browser. Took me a bit more than I am proud to say to find that out :)

Thanks for this. It went through my mind, your post confirmed it. Thank you

@llorensio
Copy link

Good morning everyone,

I want to share my experience with the Haier HON integration for Home Assistant, which I have been using to control my air conditioner. After facing constant issues with this integration, I suspect that Haier is not interested in allowing their platform to work smoothly with open-source projects like Home Assistant.

For this reason, I have decided to abandon this integration and switch to ESPHome Haier (https://esphome.io/components/climate/haier.html). I have been using it for a few days now, and so far, it performs much better than the Haier HON integration.

I hope this information helps anyone who, like me, is tired of dealing with ongoing integration problems.

Best regards!

@ndom91
Copy link

ndom91 commented Feb 9, 2025

Can confirm that I got it to work with the "Additional CA" addon (mentioned above) from HACS as well 🥳

My configuration.yaml then looks like this:

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

additional_ca:
  rapidssl: rapidssl.crt

Just make sure that you put your additional CA certs into the .../homeassistant/custom_components/additional_ca directory, not ../homeassistant/additional_ca. After a restart of HA it picked up the certs and was able to communicate over https with the account2.hon-smarthome.com host again!

@kubasaw
Copy link

kubasaw commented Feb 9, 2025

I've fixed the issue with Haier's incorrect SSL certificate configuration in my fork: https://github.com/IoTLabs-pl/hOn. The solution is based on the approach used in hass-additional-ca.

If the RapidSSL certificates are missing, they are now automatically added and will be available for communication after an HA restart.

I’d really appreciate it if you could test it out, and even more if you have some time to help maintain and improve it! 🚀

@paroque28
Copy link

paroque28 commented Feb 10, 2025

Thanks a lot @kubasaw I'll try it out
Unfortunately I see this:

  File "/usr/local/lib/python3.13/site-packages/pyhon/apis/api.py", line 79, in load_appliances_data
    await self.call("appliance", response_path=("payload", "appliances")) or []
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyhon/apis/api.py", line 65, in call
    async with self._session.request(
               ~~~~~~~~~~~~~~~~~~~~~^
        "POST" if data else "GET",
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        json=data,
        ^^^^^^^^^^
    ) as response:
    ^
  File "/usr/local/lib/python3.13/contextlib.py", line 214, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyhon/apis/wrappers/data.py", line 38, in request
    async with super().request(method, *args, **kwargs) as response:
               ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/contextlib.py", line 214, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyhon/apis/wrappers/_base.py", line 68, in request
    headers = (headers or {}) | (await self._extra_headers())
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyhon/apis/wrappers/data.py", line 24, in _extra_headers
    "cognito-token": await self._auth.get_cognito_token(),
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyhon/apis/auth.py", line 187, in get_cognito_token
    with self._session.history_tracker:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/contextlib.py", line 162, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyhon/apis/wrappers/_base.py", line 55, in history_tracker
    self._log_history(str(e))
    ~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyhon/apis/wrappers/_base.py", line 113, in _log_history
    self._history[-1].response_text,
    ~~~~~~~~~~~~~^^^^
IndexError: deque index out of range

@pellimark
Copy link

pellimark commented Feb 11, 2025

When i attempt to use pyhOn or the HACS integration, i receive the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/dist-packages/aiohttp/connector.py", line 1122, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs, sock=sock)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/base_events.py", line 1149, in create_connection
    transport, protocol = await self._create_connection_transport(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/base_events.py", line 1182, in _create_connection_transport
    await waiter
  File "/usr/lib/python3.12/asyncio/sslproto.py", line 578, in _on_handshake_complete
    raise handshake_exc
  File "/usr/lib/python3.12/asyncio/sslproto.py", line 560, in _do_handshake
    self._sslobj.do_handshake()
  File "/usr/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 "/usr/local/bin/pyhOn", line 8, in
sys.exit(start())
^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pyhon/main.py", line 107, in start
asyncio.run(main())
File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pyhon/main.py", line 75, in main
async with Hon(*get_login_data(args), test_data_path=test_data_path) as hon:
File "/usr/local/lib/python3.12/dist-packages/pyhon/hon.py", line 41, in aenter
return await self.create()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pyhon/hon.py", line 77, in create
await self.setup()
File "/usr/local/lib/python3.12/dist-packages/pyhon/hon.py", line 104, in setup
appliances = await self.api.load_appliances()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/api.py", line 86, in load_appliances
async with self._hon.get(f"{const.API_URL}/commands/v1/appliance") as resp:
File "/usr/lib/python3.12/contextlib.py", line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/handler/base.py", line 64, in get
async with self._intercept(*args, **kwargs) as response:
File "/usr/lib/python3.12/contextlib.py", line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/handler/hon.py", line 75, in _intercept
kwargs["headers"] = await self._check_headers(kwargs.get("headers", {}))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/handler/hon.py", line 64, in _check_headers
await self.auth.authenticate()
File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/auth.py", line 261, in authenticate
if not await self._load_login():
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/auth.py", line 104, in _load_login
login_url = await self._introduce()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/auth.py", line 120, in _introduce
async with self._request.get(url) as response:
File "/usr/lib/python3.12/contextlib.py", line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/handler/base.py", line 64, in get
async with self._intercept(*args, **kwargs) as response:
File "/usr/lib/python3.12/contextlib.py", line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pyhon/connection/handler/auth.py", line 36, in _intercept
async with method(url, *args, **kwargs) as response:
File "/usr/local/lib/python3.12/dist-packages/aiohttp/client.py", line 1425, in aenter
self._resp: _RetType = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/aiohttp/client.py", line 703, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/aiohttp/connector.py", line 548, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/aiohttp/connector.py", line 1056, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/aiohttp/connector.py", line 1400, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.12/dist-packages/aiohttp/connector.py", line 1369, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/aiohttp/connector.py", line 1124, in _wrap_create_connection
raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host account2.hon-smarthome.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')]
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f57ed1047d0>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f57ed104800>

> 
> This happens both on my HomeAssistant host and on my local machine.



I tried both installing crt's from terminal and addition ca, but still keep getting the ssl error

2025-02-11 08:40:55.871 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry pellimark for hon
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1116, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs, sock=sock)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/base_events.py", line 1182, in create_connection
    transport, protocol = await self._create_connection_transport(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        ssl_shutdown_timeout=ssl_shutdown_timeout)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/base_events.py", line 1215, in _create_connection_transport
    await waiter
  File "/usr/local/lib/python3.13/asyncio/sslproto.py", line 578, in _on_handshake_complete
    raise handshake_exc
  File "/usr/local/lib/python3.13/asyncio/sslproto.py", line 560, in _do_handshake
    self._sslobj.do_handshake()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/ssl.py", line 951, in do_handshake
    self._sslobj.do_handshake()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1020)

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

@paroque28
Copy link

@kubasaw it works well.
I just didn't see your LOGGER print that says to restart homeassistant. Maybe make it an error instead of info

@paroque28
Copy link

paroque28 commented Feb 11, 2025

And I have implemented the fix here as well:
https://github.com/paroque28/hon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests