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: