Skip to content

Commit 3be1f42

Browse files
authored
Merge pull request #2449 from AppDaemon/ha-ssl
fixed/simplified default ssl context
2 parents 6331c4f + c2f34d1 commit 3be1f42

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

appdaemon/plugins/hass/hassplugin.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,8 @@ def create_session(self) -> aiohttp.ClientSession:
121121
"""Handles creating an :py:class:`~aiohttp.ClientSession` with the cert information from the plugin config
122122
and the authorization headers for the `REST API <https://developers.home-assistant.io/docs/api/rest>`_.
123123
"""
124-
if self.config.cert_path is not None:
125-
ssl_context = ssl.create_default_context(capath=self.config.cert_path)
126-
conn = aiohttp.TCPConnector(ssl_context=ssl_context, verify_ssl=self.config.cert_verify)
127-
else:
128-
conn = aiohttp.TCPConnector(ssl=False)
124+
ssl_context = ssl.create_default_context(capath=self.config.cert_path)
125+
conn = aiohttp.TCPConnector(ssl_context=ssl_context)
129126

130127
connect_timeout_secs = self.config.connect_timeout.total_seconds()
131128
return aiohttp.ClientSession(

docs/HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
- Fix for sunrise and sunset with offsets - contributed by [ekutner](https://github.com/ekutner)
1212
- Fix for random MQTT disconnects - contributed by [Xsandor](https://github.com/Xsandor)
13+
- Fix for connecting to Home Assistant with https
1314
- Fix for persistent namespaces in Python 3.12
1415
- Better error handling for receiving huge websocket messages in the Hass plugin
1516

0 commit comments

Comments
 (0)