reverseproxy: use async exec
This commit is contained in:
@@ -1818,10 +1818,7 @@ async function setCertificate(app, data, auditSource) {
|
||||
const domainObject = await domains.get(domain);
|
||||
if (domainObject === null) throw new BoxError(BoxError.NOT_FOUND, 'Domain not found');
|
||||
|
||||
if (cert && key) {
|
||||
const error = reverseProxy.validateCertificate(subdomain, domain, { cert, key });
|
||||
if (error) throw error;
|
||||
}
|
||||
if (cert && key) await reverseProxy.validateCertificate(subdomain, domain, { cert, key });
|
||||
|
||||
const certificate = cert && key ? { cert, key } : null;
|
||||
const result = await database.query('UPDATE locations SET certificateJson=? WHERE location=? AND domain=?', [ certificate ? JSON.stringify(certificate) : null, subdomain, domain ]);
|
||||
|
||||
Reference in New Issue
Block a user