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")