Skip to content

Commit

Permalink
add custom ssl check
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Feb 7, 2020
1 parent 5dc9899 commit 2e1f310
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plogical/renew.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ def SSLObtainer(self):
if int(diff.days) >= 15:
logging.writeToFile(
'SSL exists for %s and is not ready to renew, skipping..' % (website.domain), 0)
elif x509.get_issuer().get_components()[1][1] == 'Denial':
elif x509.get_issuer().get_components()[1][1].decode('utf-8') == 'Denial':
logging.writeToFile(
'SSL exists for %s and ready to renew..' % (website.domain), 0)
logging.writeToFile(
'Renewing SSL for %s..' % (website.domain), 0)

virtualHostUtilities.issueSSL(website.domain, '/home/%s/public_html' % (website.domain),
website.adminEmail)
elif x509.get_issuer().get_components()[1][1].decode('utf-8') != "Let's Encrypt":
logging.writeToFile(
'Custom SSL exists for %s and ready to renew..' % (website.domain), 1)
else:
logging.writeToFile(
'SSL exists for %s and ready to renew..' % (website.domain), 0)
Expand Down

0 comments on commit 2e1f310

Please sign in to comment.