mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
🔱: [acme] sync upgrade with 3 commits [trident-sync]
Clean up eslintrc, style refactor and formatting fixes Update auto.js see https://github.com/publishlab/node-acme-client/issues/88#issuecomment-2105255828
This commit is contained in:
@@ -13,10 +13,9 @@ const defaultOpts = {
|
||||
skipChallengeVerification: false,
|
||||
challengePriority: ['http-01', 'dns-01'],
|
||||
challengeCreateFn: async () => { throw new Error('Missing challengeCreateFn()'); },
|
||||
challengeRemoveFn: async () => { throw new Error('Missing challengeRemoveFn()'); }
|
||||
challengeRemoveFn: async () => { throw new Error('Missing challengeRemoveFn()'); },
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* ACME client auto mode
|
||||
*
|
||||
@@ -25,8 +24,8 @@ const defaultOpts = {
|
||||
* @returns {Promise<buffer>} Certificate
|
||||
*/
|
||||
|
||||
module.exports = async function(client, userOpts) {
|
||||
const opts = Object.assign({}, defaultOpts, userOpts);
|
||||
module.exports = async (client, userOpts) => {
|
||||
const opts = { ...defaultOpts, ...userOpts };
|
||||
const accountPayload = { termsOfServiceAgreed: opts.termsOfServiceAgreed };
|
||||
|
||||
if (!Buffer.isBuffer(opts.csr)) {
|
||||
@@ -37,7 +36,6 @@ module.exports = async function(client, userOpts) {
|
||||
accountPayload.contact = [`mailto:${opts.email}`];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register account
|
||||
*/
|
||||
@@ -53,7 +51,6 @@ module.exports = async function(client, userOpts) {
|
||||
await client.createAccount(accountPayload);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse domains from CSR
|
||||
*/
|
||||
@@ -64,7 +61,6 @@ module.exports = async function(client, userOpts) {
|
||||
|
||||
log(`[auto] Resolved ${uniqueDomains.length} unique domains from parsing the Certificate Signing Request`);
|
||||
|
||||
|
||||
/**
|
||||
* Place order
|
||||
*/
|
||||
@@ -76,7 +72,6 @@ module.exports = async function(client, userOpts) {
|
||||
|
||||
log(`[auto] Placed certificate order successfully, received ${authorizations.length} identity authorizations`);
|
||||
|
||||
|
||||
/**
|
||||
* Resolve and satisfy challenges
|
||||
*/
|
||||
@@ -164,7 +159,6 @@ module.exports = async function(client, userOpts) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Wait for all challenge promises to settle
|
||||
*/
|
||||
@@ -178,7 +172,6 @@ module.exports = async function(client, userOpts) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Finalize order and download certificate
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user