Commit ca70a507 authored by Loic Baron's avatar Loic Baron
Browse files

util Authentication fixed create_self_signed_cert

parent aaf7d25e
Pipeline #2621 failed with stage
......@@ -75,9 +75,11 @@ class Authentication(object):
k = crypto.PKey()
k.generate_key(crypto.TYPE_RSA, 2048)
else:
if isinstance(private_key, str):
with open(private_key, 'r') as key_file:
private_key = key_file.read()
try:
with open(private_key, 'r') as pkey:
private_key = pkey.read()
except (OSError, FileNotFoundError):
pass
k = crypto.load_privatekey(crypto.FILETYPE_PEM, private_key)
# create a self-signed cert
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment