mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Do not include xmpp-upload in certificates of "child" domains
Co-Authored-By: Alexandre Aubin <alex.aubin@mailoo.org>
This commit is contained in:
parent
22c88dc47e
commit
c42f7172f7
1 changed files with 9 additions and 7 deletions
|
@ -639,13 +639,15 @@ def _prepare_certificate_signing_request(domain, key_file, output_folder):
|
||||||
# Set the domain
|
# Set the domain
|
||||||
csr.get_subject().CN = domain
|
csr.get_subject().CN = domain
|
||||||
|
|
||||||
# Include xmpp-upload subdomain in subject alternate names
|
from yunohost.domain import domain_list
|
||||||
subdomain="xmpp-upload." + domain
|
# For "parent" domains, include xmpp-upload subdomain in subject alternate names
|
||||||
try:
|
if domain in domain_list(exclude_subdomains=True)["domains"]:
|
||||||
_dns_ip_match_public_ip(get_public_ip(), subdomain)
|
subdomain="xmpp-upload." + domain
|
||||||
csr.add_extensions([crypto.X509Extension("subjectAltName", False, "DNS:" + subdomain)])
|
try:
|
||||||
except YunohostError:
|
_dns_ip_match_public_ip(get_public_ip(), subdomain)
|
||||||
logger.warning(m18n.n('certmanager_warning_subdomain_dns_record', subdomain=subdomain, domain=domain))
|
csr.add_extensions([crypto.X509Extension("subjectAltName", False, "DNS:" + subdomain)])
|
||||||
|
except YunohostError:
|
||||||
|
logger.warning(m18n.n('certmanager_warning_subdomain_dns_record', subdomain=subdomain, domain=domain))
|
||||||
|
|
||||||
# Set the key
|
# Set the key
|
||||||
with open(key_file, 'rt') as f:
|
with open(key_file, 'rt') as f:
|
||||||
|
|
Loading…
Add table
Reference in a new issue