rroller / dahua

Dahua Camera and Doorbell Home Assistant Integration
MIT License
382 stars 73 forks source link

Ignore TSL Error #314

Open federicotravaini opened 9 months ago

federicotravaini commented 9 months ago

I am trying to connect to a NVR out of my LAN. I can do it via web browser but I have to ignore self-signed certificate error. I can't integrate the NVR in HA.

Describe the solution you'd like I just try to add the NVR and it doesn't work. If I disable https it works instead.

This is the log

This error originated from a custom integration.

Logger: custom_components.dahua
Source: custom_components/dahua/config_flow.py:188
Integration: Dahua (documentation, issues)
First occurred: 10:51:33 AM (1 occurrences)
Last logged: 10:51:33 AM

Could not connect to Dahua device. For iMou devices see https://github.com/rroller/dahua/issues/6
Traceback (most recent call last):
  File "/config/custom_components/dahua/config_flow.py", line 188, in _test_credentials
    data = await client.get_machine_name()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/client.py", line 121, in get_machine_name
    return await self.get("/cgi-bin/magicBox.cgi?action=getMachineName")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/client.py", line 775, in get
    raise exception
  File "/config/custom_components/dahua/client.py", line 757, in get
    response = await auth.request("GET", url)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/digest.py", line 46, in request
    response = await self.session.request(method, url, headers=headers, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 560, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 899, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/streams.py", line 616, in read
    await self._waiter
aiohttp.client_exceptions.ClientOSError: [Errno 104] Connection reset by peer