1
0
mirror of https://github.com/moepman/acertmgr.git synced 2024-11-14 06:55:29 +01:00

New format: ca to be able to create cert-chains.

This commit is contained in:
Markus 2016-02-21 15:27:46 +01:00
parent 0346a6b492
commit 23b70c798c
2 changed files with 8 additions and 1 deletions

View File

@ -47,6 +47,7 @@ mode: webdir
#mode: standalone
#port: 13135
webdir: /var/www/acme-challenge/
cafile: /etc/acme/letencrypt_ca.crt
defaults:
format: crt

View File

@ -165,6 +165,7 @@ def cert_get(domain, settings):
# @return the action to be executed after the certificate update
def cert_put(domain, settings):
# TODO error handling
ca_file = settings.get("cafile", "")
crt_user = settings['user']
crt_group = settings['group']
crt_perm = settings['perm']
@ -185,7 +186,12 @@ def cert_put(domain, settings):
src_fd = open(key_file, "r")
crt_fd.write(src_fd.read())
src_fd.close()
# TODO fmt == "ca":
if fmt == "ca":
if not os.path.isfile(ca_file):
raise FileNotFoundError("The server key file (%s) is missing!" % ca_file)
src_fd = open(ca_file, "r")
crt_fd.write(src_fd.read())
src_fd.close()
else:
# TODO error handling
pass