fwestenberg / reolink_dev

Home Assistant Reolink addon
MIT License
550 stars 102 forks source link

HA Stream no longer working after last update #407

Closed dirtymike0330 closed 2 years ago

dirtymike0330 commented 2 years ago

Describe the bug

Getting error: Error with media stream contents (bufferIncompatibleCodecsError) on my dashboard cards now. Live stream will not load at all. Was working fine before last update.

To Reproduce Steps to reproduce the behavior. Please provide the error from the log if possible.

Expected behavior Livestream continuing to show on my dashboard or in HA period

Screenshots If applicable, add screenshots to help explain your problem.

Environment: Please provide useful information about your environment, like:

Additional context Add any other context about the problem here. 2 1

Vartkat commented 2 years ago

Same here RLC-511WA.

image

Tried to disable/enable integration. Restart server.... No success And nothing in the logs.

KruyKaze commented 2 years ago

It turns out it was an SSL handshake issue : Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa File "/usr/lib/python3.10/asyncio/base_events.py", line 1080, in create_connection transport, protocol = await self._create_connection_transport( File "/usr/lib/python3.10/asyncio/base_events.py", line 1110, in _create_connection_transport await waiter File "/usr/lib/python3.10/asyncio/sslproto.py", line 528, in data_received ssldata, appdata = self._sslpipe.feed_ssldata(data) File "/usr/lib/python3.10/asyncio/sslproto.py", line 188, in feed_ssldata self._sslobj.do_handshake() File "/usr/lib/python3.10/ssl.py", line 974, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997)

I disabled HTTPS and it worked but it's not ideal

cpainchaud commented 2 years ago

hmm strangely I am running same camera, same firmware and I don't get that SSL failure issue. SSLv3 is very old and should not be used by any modern software so it's strange. Btw until 4 weeks ago, this integration was not using SSL at all.

What is the output of this command? openssl s_client -host your_camera_ip -port 443

KruyKaze commented 2 years ago

I get this . I'd like to mention that I'm on python 3.10 now maybe it's related

`openssl s_client -host REDACTED -port 443
CONNECTED(00000003) Can't use SSL_get_servername depth=0 C = CN, ST = GD, L = SZ, O = reo-link, CN = reo-link, emailAddress = service@reo-link.com verify error:num=18:self signed certificate verify return:1 depth=0 C = CN, ST = GD, L = SZ, O = reo-link, CN = reo-link, emailAddress = service@reo-link.com verify return:1

Certificate chain 0 s:C = CN, ST = GD, L = SZ, O = reo-link, CN = reo-link, emailAddress = service@reo-link.com i:C = CN, ST = GD, L = SZ, O = reo-link, CN = reo-link, emailAddress = service@reo-link.com

Server certificate -----BEGIN CERTIFICATE----- REDACTED -----END CERTIFICATE----- subject=C = CN, ST = GD, L = SZ, O = reo-link, CN = reo-link, emailAddress = service@reo-link.com

issuer=C = CN, ST = GD, L = SZ, O = reo-link, CN = reo-link, emailAddress = service@reo-link.com


No client certificate CA names sent

SSL handshake has read 931 bytes and written 483 bytes Verification error: self signed certificate

New, TLSv1.2, Cipher is AES256-GCM-SHA384 Server public key is 1024 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session: Protocol : TLSv1.2 Cipher : AES256-GCM-SHA384 Session-ID: REDACTED Session-ID-ctx: Master-Key: REDACTED PSK identity: None PSK identity hint: None SRP username: None TLS session ticket lifetime hint: 300 (seconds) TLS session ticket: REDACTED

Start Time: 1639642235
Timeout   : 7200 (sec)
Verify return code: 18 (self signed certificate)
Extended master secret: no`
cpainchaud commented 2 years ago

well it's saying New, TLSv1.2, Cipher is AES256-GCM-SHA384 so I suppose the sslv3 is coming from something else. May be python 3.10 as you mentioned even if I doubt it.

If you have some python skills, you could try to call your camera https url with iohttp and try various ssl settings until they work and let me know what settings you had to use to make them work (https://docs.aiohttp.org/en/stable/client_quickstart.html):

import aiohttp
import asyncio

async def main():
    async with aiohttp.ClientSession() as session:
        async with session.get('http://httpbin.org/get') as resp:
            print(resp.status)
            print(await resp.text())

asyncio.run(main)
dirtymike0330 commented 2 years ago

On my end, I just decided to leave this integration and went with a frigate docker + frigate integration in my home assistant docker. Feel free to close issue at your discretion.

KruyKaze commented 2 years ago

I'm not a dev unfortunately. Should I open a new issue then? Thanks