crypto: open files in read-only mode for importing (#2536)
closes #2535
This commit is contained in:
parent
a3eb72d160
commit
8b95e9f97a
|
@ -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)
|
||||
|
|
Reference in New Issue