Fix acme refactoring
This commit is contained in:
@@ -369,7 +369,7 @@ async function ensureCertificate(subdomain, domain, auditSource) {
|
|||||||
return { certificatePath: getFallbackCertificatePathSync(domain), renewed: false };
|
return { certificatePath: getFallbackCertificatePathSync(domain), renewed: false };
|
||||||
}
|
}
|
||||||
|
|
||||||
const { acmeApi, apiOptions } = await getAcmeApi(domainObject);
|
const { acme2, apiOptions } = await getAcmeApi(domainObject);
|
||||||
let notAfter = null;
|
let notAfter = null;
|
||||||
|
|
||||||
const [, acmeCertificatePath] = await safe(syncAcmeCertificate(subdomain, domainObject));
|
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)}`);
|
debug(`ensureCertificate: getting certificate for ${subdomain} with options ${JSON.stringify(apiOptions)}`);
|
||||||
|
|
||||||
const acmePaths = getAcmeCertificatePathSync(subdomain, domainObject);
|
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'}`);
|
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 }));
|
await safe(eventlog.add(acmeCertificatePath ? eventlog.ACTION_CERTIFICATE_RENEWAL : eventlog.ACTION_CERTIFICATE_NEW, auditSource, { domain: subdomain, errorMessage: error ? error.message : '', notAfter }));
|
||||||
|
|||||||
Reference in New Issue
Block a user