chore: axios proxy问题修复

This commit is contained in:
xiaojunnuo
2024-03-08 17:42:47 +08:00
parent 5b576112d1
commit 8d44171875
5 changed files with 30 additions and 13 deletions
+15 -3
View File
@@ -187,10 +187,22 @@ module.exports = async function(client, userOpts) {
}
await runPromisesSerially(challengePromises);
try {
await runPromisesSerially(challengePromises);
}
finally {
await runPromisesSerially(clearTasks);
}
// try {
// await Promise.allSettled(challengePromises);
// }
// finally {
// log('清理challenge');
// await Promise.allSettled(clearTasks);
// }
log('清理challenge');
await runPromisesSerially(clearTasks);
log('challenge结束');
// log('[auto] Waiting for challenge valid status');
+11 -1
View File
@@ -3,10 +3,20 @@
*/
const { createHmac, createSign, constants: { RSA_PKCS1_PADDING } } = require('crypto');
const HttpsProxyAgent = require('https-proxy-agent');
const { getJwk } = require('./crypto');
const { log } = require('./logger');
const axios = require('./axios');
const axios1 = require('./axios');
const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy;
let httpsAgent = null;
if (httpsProxy) {
httpsAgent = new HttpsProxyAgent(httpsProxy);
}
const axios = axios1.create({
proxy: false,
httpsAgent
});
/**
* ACME HTTP client