From 6cfc2ad488da44145a14875b687037dfab6656ae Mon Sep 17 00:00:00 2001 From: usmannasir Date: Fri, 19 Jan 2024 11:55:55 +0500 Subject: [PATCH] bug fix: dns config reset --- plogical/virtualHostUtilities.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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')