diff options
Diffstat (limited to 'dev-python/aiopylgtv')
-rw-r--r-- | dev-python/aiopylgtv/Manifest | 3 | ||||
-rw-r--r-- | dev-python/aiopylgtv/aiopylgtv-0.4.1-r1.ebuild (renamed from dev-python/aiopylgtv/aiopylgtv-0.4.1.ebuild) | 9 | ||||
-rw-r--r-- | dev-python/aiopylgtv/files/aiopylgtv-0.4.1-ssl.patch | 124 |
3 files changed, 133 insertions, 3 deletions
diff --git a/dev-python/aiopylgtv/Manifest b/dev-python/aiopylgtv/Manifest index d2e2fdc28844..1e46058d0eb4 100644 --- a/dev-python/aiopylgtv/Manifest +++ b/dev-python/aiopylgtv/Manifest @@ -1,3 +1,4 @@ +AUX aiopylgtv-0.4.1-ssl.patch 5166 BLAKE2B 0a30dbc89a94afbb217fbe29f7928e00db78a3b0679a7085222c03d65d09bd22405c892c5ab436dd915fb772799fcf7a2c3f7b85260648bfa4e63f2999f66fb9 SHA512 8fa01bdb068795868a5ce04d07529cb45a162651c864c8d1179c46849cd6f9f6bcd61b3a7c75e6d83d9e7125df7614c0c4f17f790d88ac7da7b8481822868d8a DIST aiopylgtv-0.4.1.tar.gz 23165 BLAKE2B a41406ae0456f44cfd0e233e2ccd86b2815646fd9677cebcaa5427f5c4aa9e1a5221e69b98d25f52ef38acc16c5a3c8f051ef70d8e1c508d555da90e8e05899a SHA512 86182ab5936714cfbbea05eeb1369321b12b687a562350e5f77617c55e613855457a9ca67dc84fd20db50d42b66a4f69bd495676813b45107fbe20ccd63210ae -EBUILD aiopylgtv-0.4.1.ebuild 552 BLAKE2B c0ab4fc7ee4a3eaaa1c48870ba36583cee526e75f441eb3bdacc152e616fc33c56974876f3f60b52a6de38f1735e802f0fd7756887fb367e33b926fa71416d44 SHA512 e87b4c9c452cedd82b2088a8852ab740592d80b077708afa821694280a58da66ea609e3c98711996c8287d6f320d95f6aa9862c431e65e6fc916ff346f329d11 +EBUILD aiopylgtv-0.4.1-r1.ebuild 616 BLAKE2B 7a374ab9b0f52d857092fab683b7d969ece3d306445734c15469d2f2c20e106b6e8c98279ebdef0aa981a034bb7df83026e266d9668119cbd70198aacd02eb72 SHA512 d75c68a616990734e3fc0ce62698710ff5dff5549693349c2d547cd8330bccc24cc46d5b5e5126cee81a3b355331bc440843cad209429a4da201b64a28fcaf4e MISC metadata.xml 378 BLAKE2B 80d6571d9eac865ed96ca389cc2435dfed5c2afc113de9953a6aa9069785479e0ca3d092b36c5c9e3ac9a5eef6e3a11302927976162bb2599be2559afdba478a SHA512 36f1b5ab8d7e3fdd165ce4ddabee3cef7539911f134a65728badbba1986cc5e83fa40275798943dae713dae9cdbcb683dd563afd98b52f0e85bf46ef6d1bc813 diff --git a/dev-python/aiopylgtv/aiopylgtv-0.4.1.ebuild b/dev-python/aiopylgtv/aiopylgtv-0.4.1-r1.ebuild index 46580be5880b..941faa54bb8b 100644 --- a/dev-python/aiopylgtv/aiopylgtv-0.4.1.ebuild +++ b/dev-python/aiopylgtv/aiopylgtv-0.4.1-r1.ebuild @@ -1,9 +1,10 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 -PYTHON_COMPAT=( python3_{9..11} ) +PYTHON_COMPAT=( python3_{9..12} ) +PYTHON_REQ_USE="ssl" DISTUTILS_USE_PEP517="setuptools" inherit distutils-r1 pypi @@ -21,3 +22,7 @@ RDEPEND=" dev-python/sqlitedict[${PYTHON_USEDEP}] >=dev-python/websockets-8.1[${PYTHON_USEDEP}] " + +PATCHES=( + "${FILESDIR}"/${P}-ssl.patch +) diff --git a/dev-python/aiopylgtv/files/aiopylgtv-0.4.1-ssl.patch b/dev-python/aiopylgtv/files/aiopylgtv-0.4.1-ssl.patch new file mode 100644 index 000000000000..aef88f399e6b --- /dev/null +++ b/dev-python/aiopylgtv/files/aiopylgtv-0.4.1-ssl.patch @@ -0,0 +1,124 @@ +From 87e1447d1fc6e6db9a9e6bc9c8b5241b149cf6dd Mon Sep 17 00:00:00 2001 +From: James Le Cuirot <chewi@gentoo.org> +Date: Sat, 14 Oct 2023 18:01:52 +0100 +Subject: [PATCH] Use WSS (SSL) connection as firmware update has removed + non-SSL support + +Closes: https://github.com/bendavid/aiopylgtv/issues/65 +--- + aiopylgtv/lg-ca.pem | 34 ++++++++++++++++++++++++++++++++++ + aiopylgtv/webos_client.py | 17 +++++++++++++++-- + setup.py | 1 + + 3 files changed, 50 insertions(+), 2 deletions(-) + create mode 100644 aiopylgtv/lg-ca.pem + +diff --git a/aiopylgtv/lg-ca.pem b/aiopylgtv/lg-ca.pem +new file mode 100644 +index 0000000..05df860 +--- /dev/null ++++ b/aiopylgtv/lg-ca.pem +@@ -0,0 +1,34 @@ ++-----BEGIN CERTIFICATE----- ++MIIF+TCCA+GgAwIBAgICEAcwDQYJKoZIhvcNAQELBQAwgacxCzAJBgNVBAYTAktS ++MQ4wDAYDVQQIDAVTZW91bDEOMAwGA1UEBwwFU2VvdWwxHDAaBgNVBAoME0xHIEVs ++ZWN0cm9uaWNzIEluYy4xFjAUBgNVBAsMDUhFIExhYm9yYXRvcnkxHDAaBgNVBAMM ++E0xHIHdlYk9TIFRWIFJvb3QgQ0ExJDAiBgkqhkiG9w0BCQEWFXNlY3VyaXR5LXBh ++cnRAbGdlLmNvbTAeFw0xODAzMTIwMTMwMjhaFw0zNDA4MTUwMTMwMjhaMG8xCzAJ ++BgNVBAYTAktSMQ4wDAYDVQQIDAVTZW91bDEcMBoGA1UECgwTTEcgRWxlY3Ryb25p ++Y3MgSW5jLjEQMA4GA1UECwwHSEUgTGFiLjEgMB4GA1UEAwwXTEdFIFNTRyBJbnRl ++cm1lZGlhdGUgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDl5xeN +++UkKyfHifIGtO4igsl/UxXosQ0qeAMadDSdI8XLHAsfEnlCDVWwYSFD76A7+GO6m ++ttN5MTlsdVJPQ/lyy032cPkz38R9MHS6sOxqOCXurkX0wN/7fTODKVkS/Q3dCqYz ++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G6qzv8r7EA0IrbWk5oBhxNet/cCExIUH/Rqivcfa7qPTsTYVSoM5J ++dw2ociET6vc2UmYzBiHV22Ez02aydOSmL4VkdR+ngxGTaCkEDBpHPLDaZ6Yzp/xB ++gCGkvL417B3rTuBvD2YYwQ2pSS9O5N0FOLFjX3L3d9ixlXwqWi07w79YONjLqjYm ++6OrYp5xtinZrxEEcdu/jt0pSOkYVG+NEg+kcLiRpxy4q7A3vVllREbLZL6R/5G3D ++ulTRmICailJN3PF+5YavaQI2H6yRdiw2OMzaLgHw3zU9NGN43mMI1q1Yl4PYA2sO ++qHkaceoSAL7CaC2ZvI51K88ekUfqC34L20hiZS8kLtE3BLS/olqMsyuAnBc+ ++-----END CERTIFICATE----- +diff --git a/aiopylgtv/webos_client.py b/aiopylgtv/webos_client.py +index 6649dc5..8d20a22 100644 +--- a/aiopylgtv/webos_client.py ++++ b/aiopylgtv/webos_client.py +@@ -5,7 +5,9 @@ import functools + import json + import logging + import os ++import ssl + from datetime import timedelta ++from importlib.resources import files + + import numpy as np + import websockets +@@ -66,7 +68,7 @@ class WebOsClient: + ): + """Initialize the client.""" + self.ip = ip +- self.port = 3000 ++ self.port = 3001 + self.key_file_path = key_file_path + self.client_key = client_key + self.web_socket = None +@@ -188,12 +190,22 @@ class WebOsClient: + ws = None + inputws = None + try: ++ cadata = files("aiopylgtv").joinpath("lg-ca.pem").read_text(encoding="ascii") ++ ++ ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) ++ ssl_context.minimum_version = ssl.TLSVersion.TLSv1_2 ++ ssl_context.verify_mode = ssl.CERT_REQUIRED ++ ssl_context.verify_flags |= ssl.VERIFY_X509_PARTIAL_CHAIN ++ ssl_context.load_verify_locations(cadata=cadata) ++ ssl_context.check_hostname = False ++ + ws = await asyncio.wait_for( + websockets.connect( +- f"ws://{self.ip}:{self.port}", ++ f"wss://{self.ip}:{self.port}", + ping_interval=None, + close_timeout=self.timeout_connect, + max_size=None, ++ ssl=ssl_context, + ), + timeout=self.timeout_connect, + ) +@@ -242,6 +254,7 @@ class WebOsClient: + inputsockpath, + ping_interval=None, + close_timeout=self.timeout_connect, ++ ssl=ssl_context, + ), + timeout=self.timeout_connect, + ) +diff --git a/setup.py b/setup.py +index 306a7d4..a7f67ef 100644 +--- a/setup.py ++++ b/setup.py +@@ -6,6 +6,7 @@ with open("README.md") as f: + setup( + name="aiopylgtv", + packages=["aiopylgtv"], ++ package_data={"aiopylgtv": ["*.pem"]}, + install_requires=["websockets>=8.1", "numpy>=1.17.0", "sqlitedict"], + python_requires=">=3.7", + zip_safe=True, +-- +2.41.0 + |