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:
|
else:
|
||||||
cert_name = path.name.replace(path.suffix, "")
|
cert_name = path.name.replace(path.suffix, "")
|
||||||
try:
|
try:
|
||||||
with open(path, "r+", encoding="utf-8") as _file:
|
with open(path, "r", encoding="utf-8") as _file:
|
||||||
body = _file.read()
|
body = _file.read()
|
||||||
if "PRIVATE KEY" in body:
|
if "PRIVATE KEY" in body:
|
||||||
private_keys[cert_name] = ensure_private_key_valid(body)
|
private_keys[cert_name] = ensure_private_key_valid(body)
|
||||||
|
|
Reference in New Issue