Skip to content

Commit

Permalink
fix(tls): Log TLS renewal errors and continue with other certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
adityahase committed May 24, 2024
1 parent f8848e4 commit 181fd05
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions press/press/doctype/tls_certificate/tls_certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,20 @@ def renew_tls_certificates():
site = frappe.db.get_value(
"Site Domain", {"tls_certificate": certificate.name, "status": "Active"}, "site"
)
if site:
site_status = frappe.db.get_value("Site", site, "status")
if (
site_status == "Active" and check_dns_cname_a(site, certificate.domain)["matched"]
):
try:
if site:
site_status = frappe.db.get_value("Site", site, "status")
if (
site_status == "Active" and check_dns_cname_a(site, certificate.domain)["matched"]
):
certificate_doc = frappe.get_doc("TLS Certificate", certificate.name)
certificate_doc._obtain_certificate()
frappe.db.commit()
if certificate.wildcard:
certificate_doc = frappe.get_doc("TLS Certificate", certificate.name)
certificate_doc._obtain_certificate()
frappe.db.commit()
if certificate.wildcard:
certificate_doc = frappe.get_doc("TLS Certificate", certificate.name)
certificate_doc._obtain_certificate()
except Exception:
log_error("TLS Renewal Exception", certificate=certificate, site=site)


def update_server_tls_certifcate(server, certificate):
Expand Down

0 comments on commit 181fd05

Please sign in to comment.