If cert_path provided - do not randomize it

This commit is contained in:
sagi
2016-05-16 21:19:44 +00:00
parent 8f696b3ad7
commit f092669347
+7 -1
View File
@@ -317,7 +317,13 @@ class Client(object):
cert_pem = OpenSSL.crypto.dump_certificate(
OpenSSL.crypto.FILETYPE_PEM, certr.body.wrapped)
cert_file, act_cert_path = le_util.unique_file(cert_path, 0o644)
if cert_path != constants.CLI_DEFAULTS['auth_cert_path']:
cert_file = le_util.safe_open(cert_path, chmod=0o644)
act_cert_path = cert_path
else:
cert_file, act_cert_path = le_util.unique_file(cert_path, 0o644)
try:
cert_file.write(cert_pem)
finally: