Closed a-nicholls closed 9 months ago
Hey there @thecode, mind taking a look at this issue as it has been labeled with an integration (webostv
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
webostv documentation webostv source (message by IssueLinks)
Additional: if I use the web browser to view https://192.168.0.3:3001 in edge it shows a certificate error and if I ignore the error has the page with "Hello World"
I'm assuming that this is an internally signed certificate that the browser does not trust.
Same here.
And the same here, I have the LG C3. Also DLNA doesn't work with the same error.
Same here as well. I have an LG OLED65GX6LA running the latest update (04.50.51). I'm running Home Assistant 2023.10.5 Supervisor 2023.10.1 Operating System 11.1 Frontend 20231005.0
On a dashboard, I no longer see an image related to the source (Netflix, iPlayer, Rakuten, etc). The error messages pasted by the OP is generated whenever I try to view the TV history status or control the TV (pause, play, etc).
Same here.
$ openssl s_client -showcerts -connect xxx.xxx.xxx.xxxx:3001 < /dev/null
Running Home Assistant container.
$ hass --version
2023.11.0
Getting the same issue:
2023-11-06 16:10:45.952 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1112, in create_connection
transport, protocol = await self._create_connection_transport(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1145, in _create_connection_transport
await waiter
File "/usr/local/lib/python3.11/asyncio/sslproto.py", line 575, in _on_handshake_complete
raise handshake_exc
File "/usr/local/lib/python3.11/asyncio/sslproto.py", line 557, in _do_handshake
self._sslobj.do_handshake()
File "/usr/local/lib/python3.11/ssl.py", line 979, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1179, in get
data, content_type = await player.async_get_media_image()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 595, in async_get_media_image
return await self._async_fetch_image_from_cache(url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1097, in _async_fetch_image_from_cache
(content, content_type) = await self._async_fetch_image(url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/webostv/media_player.py", line 483, in _async_fetch_image
response = await websession.get(url, ssl=ssl_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1209, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1178, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 982, in _wrap_create_connection
raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host 192.168.3.9:3001 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')]
same here
Home Assistant
Core 2023.11.1
Supervisor 2023.11.0
Frontend 20231030.1
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403
First occurred: 10:19:27 (2 occurrences)
Last logged: 10:19:27
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1112, in create_connection
transport, protocol = await self._create_connection_transport(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1145, in _create_connection_transport
await waiter
File "/usr/local/lib/python3.11/asyncio/sslproto.py", line 575, in _on_handshake_complete
raise handshake_exc
File "/usr/local/lib/python3.11/asyncio/sslproto.py", line 557, in _do_handshake
self._sslobj.do_handshake()
File "/usr/local/lib/python3.11/ssl.py", line 979, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1179, in get
data, content_type = await player.async_get_media_image()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 595, in async_get_media_image
return await self._async_fetch_image_from_cache(url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1097, in _async_fetch_image_from_cache
(content, content_type) = await self._async_fetch_image(url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/webostv/media_player.py", line 483, in _async_fetch_image
response = await websession.get(url, ssl=ssl_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1209, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1178, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 982, in _wrap_create_connection
raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host 192.168.1.153:3001 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')]
Has this fix been released yet?
I guess not? Any update on when we will see this? I'm all up to date and still getting the same SSL validation errors with my LG OLED. I also have no media images displayed as background in either the default Lovelace media player or custom Mini Media Player cards.
@sehnugr Same here. I'm not sure what the hold-up is here but it seems that a fix for this problem was developed almost two months ago but has yet to be approved by the code owner - see Don't check SSL certificate retrieving webos image #104014
@vumaddibly for now i have a workaround. I installed the version with the fix as a custom component myself (read this somewhere else). When this fix is released i can remove it again.
Thanks @sehnugr. Where did you find the custom component and what steps are required to install it?
@vumaddibly I'm sorry, i didn't download a custom component. I basically "made" my own. What i did was download the homeasssistant code, located the webostv folder under components. Changed the few lines of code mentioned in the commit and then deployed that webostv folder under the custom components folder of my installation. Rebooted homeassistant and it worked. (I was searching for a way to override the default component and stumbled onto a thread describing this, can't find that specific thread anymore though)
@sehnugr, I've yet to find time to look at this any further. I'm curious ... do you also see timeout messages in the log immediately after you turn on the TV using the remote? My logs typically include the following errors and the repeat messages only stop when I manually reload the LG webOS Smart TV integration.
2024-01-22 17:03:47.213 WARNING (MainThread) [homeassistant.components.media_player] Updating webostv media_player took longer than the scheduled update interval 0:00:10
2024-01-22 17:03:47.215 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.lounge_tv is taking over 10 seconds
2024-01-22 17:03:57.214 WARNING (MainThread) [homeassistant.components.media_player] Updating webostv media_player took longer than the scheduled update interval 0:00:10
2024-01-22 17:04:07.215 WARNING (MainThread) [homeassistant.components.media_player] Updating webostv media_player took longer than the scheduled update interval 0:00:10
Here's a workaround.
docker exec -it homeassistant bash
cp -R /usr/src/homeassistant/homeassistant/components/webostv /config/custom_components/webostv
manifest.json
file and add a version
property with a valid semver:{
"domain": "webostv",
"name": "LG webOS Smart TV",
"version": "0.0.0-patch",
"codeowners": ["@thecode"],
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/webostv",
"iot_class": "local_push",
"loggers": ["aiowebostv"],
"quality_scale": "platinum",
"requirements": ["aiowebostv==0.3.3"],
"ssdp": [
{
"st": "urn:lge-com:service:webos-second-screen:1"
}
]
}
apply the changes from https://github.com/home-assistant/core/pull/104014 on media_player.py
(or implement your own changes to validate the cert against the official LG ones).
restart home assistant
enjoy
keep an eye on the updates and remove the custom override when the issue has been
Just a note for the solution above @attiss, I think point 2 needs to read:
cp -R /usr/src/homeassistant/homeassistant/components/webostv /config/custom_components/webostv
as the module name needs to be the last part of the path for ha to pick it up according to the docs you linked. I've tested this on my own install.
@attiss, will your workaround work on a HAOS bare metal installation?
I believe this override works for all installation methods. You will need to find the correct path of the webostv
core integration as well as the path of the custom_components
folder, those are very likely to differ.
The problem
With the webostv integration, if I use a home assistant dashboard with the media player to that LG TV entity active on the web browser/app and I change the LG TV app (e.g. switch to Netflix or ITV X as in example) that is running on the LG TV it shows a the error in the home assistant logs (showing the last line of the trace)
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host 192.168.0.3:3001 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')]
This IP is the LG TV using the webostv, with debug on the line before in the log shows:DEBUG (MainThread) [aiowebostv] recv(192.168.0.3): {"type":"response","id":4,"payload":{"subscribed":true,"returnValue":true,"appId":"com.fvp.itv","processId":"","windowId":""}}
What version of Home Assistant Core has the issue?
core-2023.10.3
What was the last working version of Home Assistant Core?
2023.9.3
What type of installation are you running?
Home Assistant OS
Integration causing the issue
webostv
Link to integration documentation on our website
https://www.home-assistant.io/integrations/webostv/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
The TV is running webOS firmware 03.33.80, it has been updated today but the problem also occurred with the previous webOS version.