mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 06:01:58 +00:00
Fixed plugin installation ssl verification issue (#101)
* Added cert location debugging * Install certifi * Try adding manual cacert in install request * Properly use ssl * More efficiently load ssl certificate
This commit is contained in:
+3
-1
@@ -13,6 +13,8 @@ from subprocess import Popen
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
import helpers
|
||||||
|
|
||||||
class PluginInstallContext:
|
class PluginInstallContext:
|
||||||
def __init__(self, artifact, name, version, hash) -> None:
|
def __init__(self, artifact, name, version, hash) -> None:
|
||||||
self.artifact = artifact
|
self.artifact = artifact
|
||||||
@@ -72,7 +74,7 @@ class PluginBrowser:
|
|||||||
self.log.info(f"Installing {name} (Version: {version})")
|
self.log.info(f"Installing {name} (Version: {version})")
|
||||||
async with ClientSession() as client:
|
async with ClientSession() as client:
|
||||||
self.log.debug(f"Fetching {artifact}")
|
self.log.debug(f"Fetching {artifact}")
|
||||||
res = await client.get(artifact)
|
res = await client.get(artifact, ssl=helpers.get_ssl_context())
|
||||||
if res.status == 200:
|
if res.status == 200:
|
||||||
self.log.debug("Got 200. Reading...")
|
self.log.debug("Got 200. Reading...")
|
||||||
data = await res.read()
|
data = await res.read()
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import ssl
|
||||||
|
import certifi
|
||||||
|
|
||||||
|
ssl_ctx = ssl.create_default_context(cafile=certifi.where())
|
||||||
|
|
||||||
|
def get_ssl_context():
|
||||||
|
return ssl_ctx
|
||||||
@@ -4,7 +4,7 @@ from json.decoder import JSONDecodeError
|
|||||||
from aiohttp import ClientSession, web
|
from aiohttp import ClientSession, web
|
||||||
|
|
||||||
from injector import inject_to_tab
|
from injector import inject_to_tab
|
||||||
|
import helpers
|
||||||
|
|
||||||
class Utilities:
|
class Utilities:
|
||||||
def __init__(self, context) -> None:
|
def __init__(self, context) -> None:
|
||||||
@@ -48,7 +48,7 @@ class Utilities:
|
|||||||
|
|
||||||
async def http_request(self, method="", url="", **kwargs):
|
async def http_request(self, method="", url="", **kwargs):
|
||||||
async with ClientSession() as web:
|
async with ClientSession() as web:
|
||||||
async with web.request(method, url, **kwargs) as res:
|
async with web.request(method, url, ssl=helpers.get_ssl_context(), **kwargs) as res:
|
||||||
return {
|
return {
|
||||||
"status": res.status,
|
"status": res.status,
|
||||||
"headers": dict(res.headers),
|
"headers": dict(res.headers),
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ aiohttp==3.8.1
|
|||||||
aiohttp-jinja2==1.5.0
|
aiohttp-jinja2==1.5.0
|
||||||
aiohttp_cors==0.7.0
|
aiohttp_cors==0.7.0
|
||||||
watchdog==2.1.7
|
watchdog==2.1.7
|
||||||
|
certifi==2022.6.15
|
||||||
Reference in New Issue
Block a user