From 675b954b0b0e4e73a3fdccdf959de76b6dac4a77 Mon Sep 17 00:00:00 2001 From: bain Date: Sat, 18 Nov 2023 21:37:23 +0100 Subject: [PATCH] fix connections to paranoid PRONOTE servers Servers can turn on encryption using the "http" attribute in the body element. --- pronotepy/pronoteAPI.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pronotepy/pronoteAPI.py b/pronotepy/pronoteAPI.py index fd32103..2477b87 100644 --- a/pronotepy/pronoteAPI.py +++ b/pronotepy/pronoteAPI.py @@ -87,9 +87,9 @@ def initialise(self) -> Tuple[Any, Any]: ) uuid = base64.b64encode( - self.encryption.aes_iv_temp - if self.root_site.startswith("https") - else self.encryption.rsa_encrypt(self.encryption.aes_iv_temp) + self.encryption.rsa_encrypt(self.encryption.aes_iv_temp) + if self.attributes.get("http", False) + else self.encryption.aes_iv_temp ).decode() # post json_post = {"Uuid": uuid, "identifiantNav": None}