test loading certif

main
Laurent 2 years ago
parent fbe46f76fd
commit 9413a35529
  1. 9
      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")

Loading…
Cancel
Save