Copy the certificate from wildcard if available

This commit is contained in:
VirtuBox
2019-08-30 06:08:54 +02:00
parent 51b698988e
commit 79469e90ad
2 changed files with 34 additions and 3 deletions

View File

@@ -760,9 +760,19 @@ class WOSiteCreateController(CementBaseController):
if ((wo_domain_type == 'subdomain') and
(not pargs.letsencrypt == 'wildcard')):
wo_subdomain = True
setupLetsEncrypt(self, wo_domain, wo_subdomain, wo_wildcard,
wo_dns, wo_acme_dns)
# check if a wildcard cert for the root domain exist
if wo_subdomain is True:
wo_exist_wildcard = checkWildcardExist(self,
wo_root_domain)
# copy the cert from the root domain
if wo_exist_wildcard is True:
copyWildcardCert(self, wo_domain, wo_root_domain)
else:
setupLetsEncrypt(self, wo_domain, wo_subdomain,
wo_wildcard, wo_dns, wo_acme_dns)
else:
setupLetsEncrypt(self, wo_domain, wo_subdomain,
wo_wildcard, wo_dns, wo_acme_dns)
httpsRedirect(self, wo_domain, True, wo_wildcard)
if pargs.hsts: