mirror of
https://github.com/moepman/acertmgr.git
synced 2025-01-01 05:31:51 +01:00
Adds support for SubjectAltName in CSR generation
To use this feature, add multiple domain names in the configuration, separated by spaces
This commit is contained in:
parent
53d2ad4bf6
commit
ffb4fde1c6
12
acertmgr.py
12
acertmgr.py
@ -147,7 +147,17 @@ def cert_get(domain, settings):
|
|||||||
server_thread.start()
|
server_thread.start()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cr = subprocess.check_output(['openssl', 'req', '-new', '-sha256', '-key', key_file, '-out', csr_file, '-subj', '/CN=%s' % domain])
|
allnames = domain.split(' ')
|
||||||
|
if len(allnames) == 1:
|
||||||
|
cr = subprocess.check_output(['openssl', 'req', '-new', '-sha256', '-key', key_file, '-out', csr_file, '-subj', '/CN=%s' % domain])
|
||||||
|
else:
|
||||||
|
cnt = 0
|
||||||
|
altnames = []
|
||||||
|
for alias in allnames[1:]
|
||||||
|
cnt = cnt + 1
|
||||||
|
altnames.append('DNS.%d=%s' % cnt, alias)
|
||||||
|
subject = '/CN=%s subjectAltName=%s' % allnames[0], ','.join(altnames)
|
||||||
|
cr = subprocess.check_output(['openssl', 'req', '-new', '-sha256', '-key', key_file, '-out', csr_file, '-reqexts', 'SAN', '-subj', subject])
|
||||||
|
|
||||||
# get certificate
|
# get certificate
|
||||||
crt = acme_tiny.get_crt(acc_file, csr_file, challenge_dir)
|
crt = acme_tiny.get_crt(acc_file, csr_file, challenge_dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user