reverseproxy: use async exec

This commit is contained in:
Girish Ramakrishnan
2024-02-21 12:33:04 +01:00
parent 9b94cf18d0
commit c1bb4de6a3
5 changed files with 90 additions and 81 deletions
+2 -6
View File
@@ -142,8 +142,7 @@ async function add(domain, data, auditSource) {
}
if (fallbackCertificate) {
let error = reverseProxy.validateCertificate('test', domain, fallbackCertificate);
if (error) throw error;
await reverseProxy.validateCertificate('test', domain, fallbackCertificate);
} else {
fallbackCertificate = await reverseProxy.generateFallbackCertificate(domain);
}
@@ -214,10 +213,7 @@ async function setConfig(domain, data, auditSource) {
zoneName = domainObject.zoneName;
}
if (fallbackCertificate) {
let error = reverseProxy.validateCertificate('test', domain, fallbackCertificate);
if (error) throw error;
}
if (fallbackCertificate) await reverseProxy.validateCertificate('test', domain, fallbackCertificate);
const tlsConfigError = validateTlsConfig(tlsConfig, provider);
if (tlsConfigError) throw tlsConfigError;