Fix acme refactoring

This commit is contained in:
Johannes Zellner
2022-08-22 12:55:43 +02:00
parent b2de6624fd
commit d20f8d5e75

View File

@@ -369,7 +369,7 @@ async function ensureCertificate(subdomain, domain, auditSource) {
return { certificatePath: getFallbackCertificatePathSync(domain), renewed: false };
}
const { acmeApi, apiOptions } = await getAcmeApi(domainObject);
const { acme2, apiOptions } = await getAcmeApi(domainObject);
let notAfter = null;
const [, acmeCertificatePath] = await safe(syncAcmeCertificate(subdomain, domainObject));
@@ -386,7 +386,7 @@ async function ensureCertificate(subdomain, domain, auditSource) {
debug(`ensureCertificate: getting certificate for ${subdomain} with options ${JSON.stringify(apiOptions)}`);
const acmePaths = getAcmeCertificatePathSync(subdomain, domainObject);
const [error] = await safe(acmeApi.getCertificate(subdomain, domain, acmePaths, apiOptions));
const [error] = await safe(acme2.getCertificate(subdomain, domain, acmePaths, apiOptions));
debug(`ensureCertificate: error: ${error ? error.message : 'null'} cert: ${acmePaths.certFilePath || 'null'}`);
await safe(eventlog.add(acmeCertificatePath ? eventlog.ACTION_CERTIFICATE_RENEWAL : eventlog.ACTION_CERTIFICATE_NEW, auditSource, { domain: subdomain, errorMessage: error ? error.message : '', notAfter }));