From 9413a35529ce337f07948aba72d271f2c8a785bd Mon Sep 17 00:00:00 2001 From: Laurent Date: Tue, 16 Jan 2024 10:45:00 +0100 Subject: [PATCH] test loading certif --- subscriptions/views.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/subscriptions/views.py b/subscriptions/views.py index 14bde1a..6ebf240 100644 --- a/subscriptions/views.py +++ b/subscriptions/views.py @@ -41,7 +41,7 @@ def app_store_webhook(request): fulljson = json.loads(decoded) signedPayload = fulljson['signedPayload'] - root_certificates = _get_root_cert(None) + root_certificates = load_root_certificate() enable_online_checks = True bundle_id = "stax.SlashPoker.nosebleed" environment = Environment.SANDBOX @@ -117,6 +117,13 @@ def app_store_webhook(request): # except (ValueError, KeyError, jwt.exceptions.PyJWTError, X509StoreContextError) as err: # raise InvalidTokenError from err # + +def load_root_certificate(): + in_file = open("AppleRootCA-G3.cer", "rb") # opening for [r]eading as [b]inary + data = in_file.read() # if you only wanted to read 512 bytes, do .read(512) + in_file.close() + return data + def _get_root_cert(root_cert_path): fn = os.environ.get("APPLE_ROOT_CA")