@certd/acme-client 1.39.10 → 1.39.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/auto.js +2 -1
- package/src/client.js +1 -1
- package/src/util.js +6 -3
- package/src/verify.js +0 -1
- package/types/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Simple and unopinionated ACME client",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "nmorsman",
|
|
6
|
-
"version": "1.39.
|
|
6
|
+
"version": "1.39.11",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"module": "scr/index.js",
|
|
9
9
|
"main": "src/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"types"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@certd/basic": "^1.39.
|
|
21
|
+
"@certd/basic": "^1.39.11",
|
|
22
22
|
"@peculiar/x509": "^1.11.0",
|
|
23
23
|
"asn1js": "^3.0.5",
|
|
24
24
|
"axios": "^1.9.0",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"bugs": {
|
|
71
71
|
"url": "https://github.com/publishlab/node-acme-client/issues"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "ec466dc818eace59825d8ae2ebbc9fc75a94a6b0"
|
|
74
74
|
}
|
package/src/auto.js
CHANGED
package/src/client.js
CHANGED
package/src/util.js
CHANGED
|
@@ -50,15 +50,18 @@ class Backoff {
|
|
|
50
50
|
|
|
51
51
|
async function retryPromise(fn, attempts, backoff, logger = log) {
|
|
52
52
|
let aborted = false;
|
|
53
|
+
let abortedFromUser = false;
|
|
53
54
|
|
|
54
55
|
try {
|
|
55
|
-
const setAbort = () => { aborted = true; }
|
|
56
|
+
const setAbort = (fromUser = false) => { aborted = true; abortedFromUser = fromUser; }
|
|
56
57
|
const data = await fn(setAbort);
|
|
57
58
|
return data;
|
|
58
59
|
}
|
|
59
60
|
catch (e) {
|
|
60
61
|
if (aborted){
|
|
61
|
-
|
|
62
|
+
if (abortedFromUser){
|
|
63
|
+
logger(`用户取消重试`);
|
|
64
|
+
}
|
|
62
65
|
throw e;
|
|
63
66
|
}
|
|
64
67
|
if ( ((backoff.attempts + 1) >= attempts)) {
|
|
@@ -249,7 +252,7 @@ async function resolveDomainBySoaRecord(recordName, logger = log) {
|
|
|
249
252
|
|
|
250
253
|
async function getAuthoritativeDnsResolver(recordName, logger = log) {
|
|
251
254
|
logger(`获取域名${recordName}的权威NS服务器: `);
|
|
252
|
-
const resolver = new dns.Resolver();
|
|
255
|
+
const resolver = new dns.Resolver({ timeout: 10000,maxTimeout: 60000 });
|
|
253
256
|
|
|
254
257
|
try {
|
|
255
258
|
/* Resolve root domain by SOA */
|
package/src/verify.js
CHANGED
|
@@ -92,7 +92,6 @@ async function walkDnsChallengeRecord(recordName, resolver = dns,deep = 0) {
|
|
|
92
92
|
try {
|
|
93
93
|
log(`检查域名 ${recordName} 的TXT记录`);
|
|
94
94
|
const txtRecords = await resolver.resolveTxt(recordName);
|
|
95
|
-
|
|
96
95
|
if (txtRecords && txtRecords.length) {
|
|
97
96
|
log(`找到 ${txtRecords.length} 条 TXT记录( ${recordName})`);
|
|
98
97
|
log(`TXT records: ${JSON.stringify(txtRecords)}`);
|