From a289ab90449ace2fdb430c20928c4b95f49858d7 Mon Sep 17 00:00:00 2001 From: Ellis Michael Date: Mon, 29 Jan 2024 11:41:53 -0800 Subject: [PATCH] Don't check SSL certificate retrieving webos image (#104014) I didn't test this in HA, but I did test this in a Python REPL, manually querying my TV. The old method for ignoring SSL certificate validation doesn't work at all. This method does and is supported by the aiohttp documentation. https://docs.aiohttp.org/en/stable/client_reference.html Fixes #102109 --- homeassistant/components/webostv/media_player.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/homeassistant/components/webostv/media_player.py b/homeassistant/components/webostv/media_player.py index f12b1c08c60..554d5e0b1d6 100644 --- a/homeassistant/components/webostv/media_player.py +++ b/homeassistant/components/webostv/media_player.py @@ -8,7 +8,6 @@ from datetime import timedelta from functools import wraps from http import HTTPStatus import logging -import ssl from typing import Any, Concatenate, ParamSpec, TypeVar, cast from aiowebostv import WebOsClient, WebOsTvPairError @@ -473,14 +472,11 @@ class LgWebOSMediaPlayerEntity(RestoreEntity, MediaPlayerEntity): SSLContext to bypass validation errors if url starts with https. """ content = None - ssl_context = None - if url.startswith("https"): - ssl_context = ssl.SSLContext(protocol=ssl.PROTOCOL_TLS_CLIENT) websession = async_get_clientsession(self.hass) with suppress(asyncio.TimeoutError): async with asyncio.timeout(10): - response = await websession.get(url, ssl=ssl_context) + response = await websession.get(url, ssl=False) if response.status == HTTPStatus.OK: content = await response.read()