@certd/acme-client 1.37.14 → 1.37.16

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/verify.js +7 -3
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.37.14",
6
+ "version": "1.37.16",
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.37.14",
21
+ "@certd/basic": "^1.37.16",
22
22
  "@peculiar/x509": "^1.11.0",
23
23
  "asn1js": "^3.0.5",
24
24
  "axios": "^1.7.2",
@@ -70,5 +70,5 @@
70
70
  "bugs": {
71
71
  "url": "https://github.com/publishlab/node-acme-client/issues"
72
72
  },
73
- "gitHead": "ddb18e6c219d0f7a7acb4a3355be5db3fd9e096e"
73
+ "gitHead": "fa14f6219810ddbfcf1dde7b69963ee8a36c80c4"
74
74
  }
package/src/verify.js CHANGED
@@ -8,7 +8,7 @@ import {log as defaultLog} from './logger.js'
8
8
  import axios from './axios.js'
9
9
  import * as util from './util.js'
10
10
  import {isAlpnCertificateAuthorizationValid} from './crypto/index.js'
11
-
11
+ import {utils} from '@certd/basic'
12
12
 
13
13
  const dns = dnsSdk.promises
14
14
 
@@ -60,11 +60,15 @@ async function verifyHttpChallenge(authz, challenge, keyAuthorization, suffix =
60
60
  }
61
61
 
62
62
  const httpPort = axios.defaults.acmeSettings.httpChallengePort || 80;
63
- const challengeUrl = `http://${authz.identifier.value}:${httpPort}${suffix}`;
63
+ let host = authz.identifier.value;
64
+ if(utils.domain.isIpv6(host)){
65
+ host = `[${host}]`;
66
+ }
67
+ const challengeUrl = `http://${host}:${httpPort}${suffix}`;
64
68
 
65
69
  if (!await doQuery(challengeUrl)) {
66
70
  const httpsPort = axios.defaults.acmeSettings.httpsChallengePort || 443;
67
- const httpsChallengeUrl = `https://${authz.identifier.value}:${httpsPort}${suffix}`;
71
+ const httpsChallengeUrl = `https://${host}:${httpsPort}${suffix}`;
68
72
  const res = await doQuery(httpsChallengeUrl)
69
73
  if (!res) {
70
74
  throw new Error(`[error] 验证失败,请检查以上测试url是否可以正常访问`);