hon: SSL unable to get local issuer certificate - WORKAROUND SOLUTION IN THIS ISSUE!

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.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 5
  • Comments: 77

Most upvoted comments

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.

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 😦

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! 🚀

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?

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

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

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 😃

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) ?

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

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!

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

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