Skip to content

Commit 5aca088

Browse files
committed
fixed/simplified default ssl context
1 parent 8edaede commit 5aca088

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

appdaemon/plugins/hass/hassplugin.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,8 @@ def create_session(self) -> aiohttp.ClientSession:
111111
"""Handles creating an :py:class:`~aiohttp.ClientSession` with the cert information from the plugin config
112112
and the authorization headers for the `REST API <https://developers.home-assistant.io/docs/api/rest>`_.
113113
"""
114-
if self.config.cert_path is not None:
115-
ssl_context = ssl.create_default_context(capath=self.config.cert_path)
116-
conn = aiohttp.TCPConnector(ssl_context=ssl_context, verify_ssl=self.config.cert_verify)
117-
else:
118-
conn = aiohttp.TCPConnector(ssl=False)
114+
ssl_context = ssl.create_default_context(capath=self.config.cert_path)
115+
conn = aiohttp.TCPConnector(ssl_context=ssl_context)
119116

120117
connect_timeout_secs = self.config.connect_timeout.total_seconds()
121118
return aiohttp.ClientSession(

0 commit comments

Comments
 (0)