diff --git a/plogical/virtualHostUtilities.py b/plogical/virtualHostUtilities.py index 11e61de42..7a8460b40 100644 --- a/plogical/virtualHostUtilities.py +++ b/plogical/virtualHostUtilities.py @@ -153,12 +153,11 @@ def OnBoardingHostName(Domain, tempStatusPath): filePath = '/etc/letsencrypt/live/%s/fullchain.pem' % (Domain) + virtualHostUtilities.issueSSLForHostName(Domain, path) + x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, open(filePath, 'r').read()) SSLProvider = x509.get_issuer().get_components()[1][1].decode('utf-8') - if SSLProvider == 'Denial': - virtualHostUtilities.issueSSLForHostName(Domain, path) - if SSLProvider == 'Denial': message = 'Failed to issue Hostname SSL, either its DNS record is not propagated or the domain ie behind Cloudflare. [404]' logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, message) @@ -167,11 +166,8 @@ def OnBoardingHostName(Domain, tempStatusPath): logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, 'Hostname SSL issued,50') - x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, open(filePath, 'r').read()) - SSLProvider = x509.get_issuer().get_components()[1][1].decode('utf-8') - if SSLProvider == 'Denial': - virtualHostUtilities.issueSSLForMailServer(Domain, path) + virtualHostUtilities.issueSSLForMailServer(Domain, path) x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, open(filePath, 'r').read()) SSLProvider = x509.get_issuer().get_components()[1][1].decode('utf-8')