diff --git a/authentik/crypto/tasks.py b/authentik/crypto/tasks.py index 20b9e1ad1..54b329800 100644 --- a/authentik/crypto/tasks.py +++ b/authentik/crypto/tasks.py @@ -61,7 +61,7 @@ def certificate_discovery(self: MonitoredTask): else: cert_name = path.name.replace(path.suffix, "") try: - with open(path, "r+", encoding="utf-8") as _file: + with open(path, "r", encoding="utf-8") as _file: body = _file.read() if "PRIVATE KEY" in body: private_keys[cert_name] = ensure_private_key_valid(body)