bosch-thermostat / home-assistant-bosch-custom-component

HA custom component for Bosch thermostats
Apache License 2.0
224 stars 45 forks source link

Certificate verify failed - CT200 on HA 2021.5.0 #74

Closed Didel closed 3 years ago

Didel commented 3 years ago

Describe the bug The following error is visible in the logs after upgrading to HomeAssistant 2021.5.0:

Logger: homeassistant.config_entries
Source: custom_components/bosch/__init__.py:250 
Integration: Bosch thermostat (documentation, issues) 
First occurred: 22:52:35 (1 occurrences) 
Last logged: 22:52:35

Error setting up entry Bosch EasyControl CT200 for bosch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 269, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/bosch/__init__.py", line 118, in async_setup_entry
    return await gateway_entry.async_init()
  File "/config/custom_components/bosch/__init__.py", line 200, in async_init
    if await self.async_init_bosch():
  File "/config/custom_components/bosch/__init__.py", line 250, in async_init_bosch
    await self.gateway.check_connection()
  File "/usr/local/lib/python3.8/site-packages/bosch_thermostat_client/gateway/base_gateway.py", line 278, in check_connection
    await self.initialize()
  File "/usr/local/lib/python3.8/site-packages/bosch_thermostat_client/gateway/base_gateway.py", line 70, in initialize
    await self._update_info(initial_db.get(GATEWAY))
  File "/usr/local/lib/python3.8/site-packages/bosch_thermostat_client/gateway/easycontrol_gateway.py", line 79, in _update_info
    response = await self._connector.get(uri)
  File "/usr/local/lib/python3.8/site-packages/bosch_thermostat_client/connectors/xmpp.py", line 75, in get
    data = await self._request(method=GET, path=path)
  File "/usr/local/lib/python3.8/site-packages/bosch_thermostat_client/connectors/xmpp.py", line 102, in _request
    await self.start()
  File "/usr/local/lib/python3.8/site-packages/bosch_thermostat_client/connectors/xmpp.py", line 93, in start
    self._xmppstream = await self._st.enter_async_context(
  File "/usr/local/lib/python3.8/contextlib.py", line 568, in enter_async_context
    result = await _cm_type.__aenter__(cm)
  File "/usr/local/lib/python3.8/site-packages/aioxmpp/node.py", line 1652, in __aenter__
    await conn_future
  File "/usr/local/lib/python3.8/site-packages/aioxmpp/node.py", line 837, in _on_main_done
    task.result()
  File "/usr/local/lib/python3.8/site-packages/aioxmpp/node.py", line 997, in _main
    await self._main_impl()
  File "/usr/local/lib/python3.8/site-packages/aioxmpp/node.py", line 952, in _main_impl
    tls_transport, xmlstream, features = await connect_xmlstream(
  File "/usr/local/lib/python3.8/site-packages/aioxmpp/node.py", line 390, in connect_xmlstream
    result = await _try_options(
  File "/usr/local/lib/python3.8/site-packages/aioxmpp/node.py", line 241, in _try_options
    transport, xmlstream, features = await conn.connect(
  File "/usr/local/lib/python3.8/site-packages/aioxmpp/connector.py", line 263, in connect
    await stream.starttls(
  File "/usr/local/lib/python3.8/site-packages/aioxmpp/protocol.py", line 747, in starttls
    await self._transport.starttls(ssl_context, post_handshake_callback)
  File "/usr/local/lib/python3.8/site-packages/aioopenssl/__init__.py", line 732, in starttls
    await self._waiter
  File "/usr/local/lib/python3.8/site-packages/aioopenssl/__init__.py", line 355, in _tls_do_handshake
    self._tls_conn.do_handshake()
  File "/usr/local/lib/python3.8/site-packages/OpenSSL/SSL.py", line 1828, in do_handshake
    self._raise_ssl_error(self._ssl, result)
  File "/usr/local/lib/python3.8/site-packages/OpenSSL/SSL.py", line 1566, in _raise_ssl_error
    _raise_current_error()
  File "/usr/local/lib/python3.8/site-packages/OpenSSL/_util.py", line 57, in exception_from_error_queue
    raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]

To Reproduce Steps to reproduce the behavior:

  1. Install and configure the Bosch integration for a CT200 thermostat in HA 2021.4 or earlier.
  2. Upgrade to HA 2021.5
  3. Navigate to the Logs
  4. See error

Version

grewhit25 commented 3 years ago

I am seeing the same error after Home-Assistant upgrade.

HA version: 2021.5.0 HA Bosch component version: v0.12.0dev9

pszafer commented 3 years ago

can you revert your HA version so it's possible to narrow down issue if it's HA/lib problem or certificate of XMPP server issue?

pszafer commented 3 years ago

Server certificate expired: image

Didel commented 3 years ago

Updating to version v0.12.1dev11 resolves this issue.