Skip to content

Commit 769a12f

Browse files
epenetfrenck
authored andcommitted
Fix blocking call in cync (home-assistant#156782)
1 parent dabaa2b commit 769a12f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

homeassistant/components/cync/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from homeassistant.core import HomeAssistant
1010
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
1111
from homeassistant.helpers.aiohttp_client import async_get_clientsession
12+
from homeassistant.util.ssl import get_default_context
1213

1314
from .const import (
1415
CONF_AUTHORIZE_STRING,
@@ -31,9 +32,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: CyncConfigEntry) -> bool
3132
expires_at=entry.data[CONF_EXPIRES_AT],
3233
)
3334
cync_auth = Auth(async_get_clientsession(hass), user=user_info)
35+
ssl_context = get_default_context()
3436

3537
try:
36-
cync = await Cync.create(cync_auth)
38+
cync = await Cync.create(
39+
auth=cync_auth,
40+
ssl_context=ssl_context,
41+
)
3742
except AuthFailedError as ex:
3843
raise ConfigEntryAuthFailed("User token invalid") from ex
3944
except CyncError as ex:

0 commit comments

Comments
 (0)