reolink_dev icon indicating copy to clipboard operation
reolink_dev copied to clipboard

Not working in HA 2022.7.0b1

Open SmarterHomeLife opened this issue 3 years ago • 47 comments

The Reolink integration doesn't work after updating to Home Assistant 2022.7.0b0, I assume this is due to the update to Python 3.10. This is the error from the logs;

Logger: homeassistant.config_entries Source: custom_components/reolink_dev/base.py:219 Integration: Reolink IP camera (documentation, issues) First occurred: 5:52:06 am (1 occurrences) Last logged: 5:52:06 am

Error setting up entry 4 Selway for reolink_dev Traceback (most recent call last): File "/usr/local/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/local/lib/python3.10/asyncio/base_events.py", line 1089, in create_connection transport, protocol = await self._create_connection_transport( File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1119, in _create_connection_transport await waiter File "/usr/local/lib/python3.10/asyncio/sslproto.py", line 534, in data_received ssldata, appdata = self._sslpipe.feed_ssldata(data) File "/usr/local/lib/python3.10/asyncio/sslproto.py", line 188, in feed_ssldata self._sslobj.do_handshake() File "/usr/local/lib/python3.10/ssl.py", line 975, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 353, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/reolink_dev/init.py", line 75, in async_setup_entry if not await base.connect_api(): File "/config/custom_components/reolink_dev/base.py", line 219, in connect_api if not await self._api.get_settings(): File "/usr/local/lib/python3.10/site-packages/reolink/camera_api.py", line 496, in get_settings response = await self.send(body) File "/usr/local/lib/python3.10/site-packages/reolink/camera_api.py", line 1652, in send if not await self.login(): File "/usr/local/lib/python3.10/site-packages/reolink/camera_api.py", line 845, in login response = await self.send(body, param) File "/usr/local/lib/python3.10/site-packages/reolink/camera_api.py", line 1696, in send async with session.post( File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 1138, in aenter self._resp = await self._coro File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection transp, proto = await self._wrap_create_connection( File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 990, in _wrap_create_connection raise ClientConnectorSSLError(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorSSLError: Cannot connect to host 10.0.4.121:443 ssl:default [[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997)]

SmarterHomeLife avatar Jun 30 '22 20:06 SmarterHomeLife

confirmed not working here as well

martymoose avatar Jul 01 '22 05:07 martymoose

and not working in 2022.7.0

cokeman0 avatar Jul 06 '22 20:07 cokeman0

Not working for me either

genkizs avatar Jul 06 '22 22:07 genkizs

Yup just updated HA and Reo Link cameras are all off the air with SSL issue.

pdegenhardt avatar Jul 07 '22 01:07 pdegenhardt

Same issue here.

harishvelli avatar Jul 07 '22 01:07 harishvelli

Can also confirm, getting the same error on 2022.7.0 for all my Reolink cameras.

xcomputerman avatar Jul 07 '22 06:07 xcomputerman

I confirm, update to 2022.7.0 and problems with the SSL protocol

ckd77 avatar Jul 07 '22 07:07 ckd77

Same here

cris1410 avatar Jul 07 '22 07:07 cris1410

what are your camera's models and firmware version? It seems to complain that your camera is using an old protocol.

cpainchaud avatar Jul 07 '22 08:07 cpainchaud

probably related: https://github.com/home-assistant/core/issues/74551 https://github.com/home-assistant/core/issues/74558

cpainchaud avatar Jul 07 '22 08:07 cpainchaud

Same here. My cams are: E1 Outdoor with FW v3.0.0.460_21071406 E1 Zoom with FW v3.0.0.716_21112408

Traseus avatar Jul 07 '22 08:07 Traseus

what are your camera's models and firmware version? It seems to complain that your camera is using an old protocol.

1 x E1 Outdoor firmware V3.0.0.748_21120806 2 x E1 Zoom firmware V3.0.0.716_2111408 (up to date)

image

ckd77 avatar Jul 07 '22 08:07 ckd77

Can you also try command: openssl s_client -connect <Your camera IP here>:443

and check which version of TLS/SSL is used?

cpainchaud avatar Jul 07 '22 08:07 cpainchaud

openssl s_client -connect :443

# openssl s_client -connect 192.168.10.82:443
CONNECTED(00000003)
Can't use SSL_get_servername
depth=0 C = CN, ST = GD, L = SZ, O = reokink, OU = REOLINK, CN = reolink, emailAddress = [email protected]
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 C = CN, ST = GD, L = SZ, O = reokink, OU = REOLINK, CN = reolink, emailAddress = [email protected]
verify error:num=21:unable to verify the first certificate
verify return:1
depth=0 C = CN, ST = GD, L = SZ, O = reokink, OU = REOLINK, CN = reolink, emailAddress = [email protected]
verify return:1
---
Certificate chain
 0 s:C = CN, ST = GD, L = SZ, O = reokink, OU = REOLINK, CN = reolink, emailAddress = [email protected]
   i:C = CN, ST = GD, L = SZ, O = REOLINK, OU = REOLINK, CN = REOLINK, emailAddress = [email protected]
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIEejCCAmICAQEwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNVBAYTAkNOMQswCQYD
VQQIDAJHRDELMAkGA1UEBwwCU1oxEDAOBgNVBAoMB1JFT0xJTksxEDAOBgNVBAsM
B1JFT0xJTksxEDAOBgNVBAMMB1JFT0xJTksxIzAhBgkqhkiG9w0BCQEWFHNlcnZp
Y2VAcmVvLWxpbmsuY29tMB4XDTIxMDgyODA3NDA0OVoXDTQxMDgyMzA3NDA0OVow
gYIxCzAJBgNVBAYTAkNOMQswCQYDVQQIDAJHRDELMAkGA1UEBwwCU1oxE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E1HMT/myDDwdxP2AAyq3T+n+Xo9f0pd2/c0ka6toa1Jn
kXB952K7LTTzv/eJE7t6hurfmMb6y5Yis7SWBN9IrYaSMFmjLqTX2zPJmW+KOElI
uN01zNytlIEb8I+Xd3wgrB1A9nvzJ+2Uk/FcC1qTYMR7xORXZXe340jCg7iJTg==
-----END CERTIFICATE-----
subject=C = CN, ST = GD, L = SZ, O = reokink, OU = REOLINK, CN = reolink, emailAddress = [email protected]

issuer=C = CN, ST = GD, L = SZ, O = REOLINK, OU = REOLINK, CN = REOLINK, emailAddress = [email protected]

---
No client certificate CA names sent
---
SSL handshake has read 1474 bytes and written 601 bytes
Verification error: unable to verify the first certificate
---
New, TLSv1.2, Cipher is AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : AES256-GCM-SHA384
    Session-ID: 5A29108A9F705DC883C90CBE59F4CD2F5C08D8221C47D9ECF79FB0E68E1360FA
    Session-ID-ctx:
    Master-Key: EF69F23F8D02690425ECAFF75D25914BC5C83BAF614DCF9C3DFCE0D4AF7AC975D6701AE94F55DF47A037E01CB218246F
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    TLS session ticket lifetime hint: 300 (seconds)
    TLS session ticket:
    0000 - ce ef 90 50 6c 2a 61 43-c9 1a bf 52 18 b0 94 0a   ...Pl*aC...R....
    0010 - 0a 91 b8 90 c8 77 d8 cb-cd 6c 85 d0 f3 c6 d6 df   .....w...l......
    0020 - d3 b9 24 b1 3a df 72 ed-e7 79 31 f9 28 4d 17 a7   ..$.:.r..y1.(M..
    0030 - 8e 27 22 0c 17 67 fb 36-e2 3b b3 18 4f c1 14 1c   .'"..g.6.;..O...
    0040 - 90 b7 64 2b af c4 44 4e-ef be 06 1e fe a5 10 e1   ..d+..DN........
    0050 - 69 69 f3 70 65 3e 46 b1-99 ec 59 81 c8 8b 3e 1c   ii.pe>F...Y...>.
    0060 - b3 d8 87 8b aa 21 48 64-27 b3 ad 87 ce 9d 1b b6   .....!Hd'.......
    0070 - e2 c0 a6 59 71 6e ff 9b-72 79 4c 84 ca 43 cc 80   ...Yqn..ryL..C..
    0080 - 1d 64 85 de 49 70 8b aa-1b 92 29 8a 22 92 29 01   .d..Ip....).".).
    0090 - 88 81 0d 91 bf b4 49 fb-f5 45 db fa 31 5a d5 e7   ......I..E..1Z..
    00a0 - f0 67 c2 21 f9 6d f5 91-05 70 6d 0b 6c b5 ab 98   .g.!.m...pm.l...

    Start Time: 1657182106
    Timeout   : 7200 (sec)
    Verify return code: 21 (unable to verify the first certificate)
    Extended master secret: no
---

ckd77 avatar Jul 07 '22 08:07 ckd77

It's looking good, HA has switched to python 3.10 and restricted some SSL protocols, I don't have the details, it will take time to understand what can be done to override their SSL requirements

cpainchaud avatar Jul 07 '22 08:07 cpainchaud

Yes, I did a personal backtrack to version 2022.6.7 in order to find my cameras and my mi flora bluetooth modules which no longer work either, as I will soon be going on vacation, I need to have a view of my plants for remote watering and the safety of my home!

ckd77 avatar Jul 07 '22 08:07 ckd77

I have installed python 3.10 in my lab and reolink base API still works so it's an HA specific setting.....

cpainchaud avatar Jul 07 '22 08:07 cpainchaud

I just recently installed a pi4 with home assistant 2022.7 on it, same problem with the SSL layer.

ckd77 avatar Jul 07 '22 08:07 ckd77

same problem with the SSL layer

calas80 avatar Jul 07 '22 10:07 calas80

After updating to core 2022.7. four of my 5 cameras stop working. That is very strange cause all 5 cameras have very similar setup. They only differ in IP adresses. So I have no idea why 1 of them continue to work and remaining 4 not.

I rolled back to 2022.6. while there will be fix.

cris1410 avatar Jul 07 '22 11:07 cris1410

An option until the issue is resolved with the integration is to use ffmpeg to stream the rtmp feed from your cameras, it won't provide motion sensor outputs or PTZ control but streams video well and allows you to upgrade to 2022.7.

  • platform: ffmpeg name: My Camera input: 'rtmp://192.168.x.x/bcs/channel0_main.bcs?channel=0&stream=0&user=user&password=password'

SmarterHomeLife avatar Jul 07 '22 11:07 SmarterHomeLife

is there away to add the movement sensors also?and maybe siren button

genkizs avatar Jul 07 '22 15:07 genkizs

I'm also having this issue after 2022.7.0 had to roll back to 2022.6.7

tagz1979 avatar Jul 07 '22 16:07 tagz1979

Please stop commenting that you experience the same issue. Just like the original post to indicate you have the same issue.

Only comment if you can provide new relevant details to clarify the issue or contribute to its potential solutions...

BTW, sorry for not being able to do either myself 😉

dykandDK avatar Jul 07 '22 17:07 dykandDK

I've been watching this issue as I have the same error in an integration I manage. Just cracked the secret code.

            context = ssl.create_default_context()
            context.set_ciphers("DEFAULT")
            context.check_hostname = False
            context.verify_mode = ssl.CERT_NONE

PeteRager avatar Jul 07 '22 17:07 PeteRager

I've been watching this issue as I have the same error in an integration I manage. Just cracked the secret code.

            context = ssl.create_default_context()
            context.set_ciphers("DEFAULT")
            context.check_hostname = False
            context.verify_mode = ssl.CERT_NONE

does this solve the issue? where do you add this snippet? Thanks.

gyorgybekes avatar Jul 07 '22 18:07 gyorgybekes

That solved my issue.

https://github.com/PeteRager/lennoxs30/issues/174

Since the errors are the same, this may be the solution also for this integration. I pass this context into the aiohttp requests using the ssl= parameter.

PeteRager avatar Jul 07 '22 18:07 PeteRager

I found that by changing the settings in my camera (RLC-822A) I got things to work via http (only) and adding again into HA. As my cameras have local access only this isn't a concern for me right now.

image

chiefcomm avatar Jul 08 '22 10:07 chiefcomm

what are your camera's models and firmware version? It seems to complain that your camera is using an old protocol.

Reolink RLC-520A and on the latest firmware.

Tovrin avatar Jul 08 '22 12:07 Tovrin

similar issue with 2022.7

Cameras RLC-822A. Log below

This error originated from a custom integration.

Logger: homeassistant.config_entries Source: custom_components/reolink_dev/base.py:219 Integration: Reolink IP camera (documentation, issues) First occurred: 19:50:43 (2 occurrences) Last logged: 19:50:43

Error setting up entry Front for reolink_dev Error setting up entry Corner for reolink_dev Traceback (most recent call last): File "/usr/local/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/local/lib/python3.10/asyncio/base_events.py", line 1089, in create_connection transport, protocol = await self._create_connection_transport( File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1119, in _create_connection_transport await waiter File "/usr/local/lib/python3.10/asyncio/sslproto.py", line 534, in data_received ssldata, appdata = self._sslpipe.feed_ssldata(data) File "/usr/local/lib/python3.10/asyncio/sslproto.py", line 188, in feed_ssldata self._sslobj.do_handshake() File "/usr/local/lib/python3.10/ssl.py", line 975, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 353, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/reolink_dev/init.py", line 75, in async_setup_entry if not await base.connect_api(): File "/config/custom_components/reolink_dev/base.py", line 219, in connect_api if not await self._api.get_settings(): File "/usr/local/lib/python3.10/site-packages/reolink/camera_api.py", line 496, in get_settings response = await self.send(body) File "/usr/local/lib/python3.10/site-packages/reolink/camera_api.py", line 1652, in send if not await self.login(): File "/usr/local/lib/python3.10/site-packages/reolink/camera_api.py", line 845, in login response = await self.send(body, param) File "/usr/local/lib/python3.10/site-packages/reolink/camera_api.py", line 1696, in send async with session.post( File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 1138, in aenter self._resp = await self._coro File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection transp, proto = await self._wrap_create_connection( File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 990, in _wrap_create_connection raise ClientConnectorSSLError(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorSSLError: Cannot connect to host 192.168.1.31:443 ssl:default [[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997)]

chimie007 avatar Jul 08 '22 18:07 chimie007