Skip to content

Commit

Permalink
disabled ssl verification
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej-or committed Oct 19, 2024
1 parent 9941315 commit ad9dff8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/hikvision_next/isapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] = []
Expand Down
4 changes: 2 additions & 2 deletions custom_components/hikvision_next/isapi_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ad9dff8

Please sign in to comment.