From ad9dff8dab9d11fb0a1c2706c9df4afd5335c706 Mon Sep 17 00:00:00 2001 From: maciej-or Date: Sat, 19 Oct 2024 20:49:50 +0200 Subject: [PATCH] disabled ssl verification --- custom_components/hikvision_next/isapi.py | 2 +- custom_components/hikvision_next/isapi_client.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/hikvision_next/isapi.py b/custom_components/hikvision_next/isapi.py index cd9f67d..f64a47e 100644 --- a/custom_components/hikvision_next/isapi.py +++ b/custom_components/hikvision_next/isapi.py @@ -189,7 +189,7 @@ def __init__( session: Optional[httpx.AsyncClient] = None, ) -> None: """Initialize.""" - self.isapi = ISAPI_Client(host, username, password, session, timeout=20) + self.isapi = ISAPI_Client(host, username, password, timeout=20) self.host = host self.device_info = HikDeviceInfo() self.cameras: list[IPCamera | AnalogCamera] = [] diff --git a/custom_components/hikvision_next/isapi_client.py b/custom_components/hikvision_next/isapi_client.py index 88d85a2..222ec82 100644 --- a/custom_components/hikvision_next/isapi_client.py +++ b/custom_components/hikvision_next/isapi_client.py @@ -40,12 +40,12 @@ class ISAPI_Client: async def _detect_auth_method(self): """Establish the connection with device.""" if not self.session: - self.session = httpx.AsyncClient(timeout=self.timeout) + self.session = httpx.AsyncClient(timeout=self.timeout, verify=False) url = urljoin(self.host, self.isapi_prefix + "/System/deviceInfo") for method in [ - httpx.BasicAuth(self.username, self.password), httpx.DigestAuth(self.username, self.password), + httpx.BasicAuth(self.username, self.password), ]: response = await self.session.get(url, auth=method) if response.status_code == 200: