acertmgr: fix initial certificate validity check

This commit is contained in:
Kishi85 2019-03-25 19:25:33 +01:00 committed by Markus Hauschild
parent 0defe1990d
commit a4daec3fc1
1 changed files with 5 additions and 3 deletions

View File

@ -151,9 +151,11 @@ def main():
# check certificate validity and obtain/renew certificates if needed
for config in configs:
cert_file = config['cert_file']
if not os.path.isfile(cert_file) or not tools.is_cert_valid(cert_file, config['ttl_days']):
cert_get(config)
cert_file_exists = os.path.isfile(cert_file)
if cert_file_exists:
cert = tools.read_pem_file(cert_file)
if not cert_file_exists or not tools.is_cert_valid(cert, config['ttl_days']):
cert_get(config)
for cfg in config['actions']:
if not tools.target_is_current(cfg['path'], cert_file):