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
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
Additional CA, as suggested hereDownloading hOn certificate
.pemfile to my computerConverting .pem to .crt
.pemfile and executed the commandopenssl x509 -outform PEM -in account2-hon-smarthome-com.pem -out account2-hon-smarthome-com.crtlike mentioned hereSaving .crt file on Home Assistant hard disk
/config/additional_calike mentioned hereaccount2-hon-smarthome-com.crtfrom my computer folder to the newly created Home Assistant folderconfig/additional_caUpdating configuration.yaml
configuration.yamland added this to the bottom of the file:configuration.yamland restarted Home AssistantNow the hOn addon worked again.
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:
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) ?
It worked for me. I saved the certificates from GoogleChrome (windows), renamed them and transferred them. Config:
That did the trick, thanks!
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.pyline 202 and replaceself._device.sync_command("stopProgram", "settings")withself._device.settings["settings.onOffStatus"].value = "0", then restart HomeAssistantlike so:
The steps @jm314159 described sound pretty much exactly right, I just didn’t have to remove hOn integration at all.
Here you just click on DigiCert, press export, and then repeat the same process for RapidSSL