Browse Source

v1.7.6: add http-01 url to challenge

tags/v1.7.6
AJ ONeal 2 months ago
parent
commit
48c6f842b4
3 changed files with 17 additions and 9 deletions
  1. 12
    4
      node.js
  2. 4
    4
      package-lock.json
  3. 1
    1
      package.json

+ 12
- 4
node.js View File

@@ -378,20 +378,28 @@ ACME._challengeToAuth = function (me, options, request, challenge, dryrun) {
378 378
   // { type, status, url, token }
379 379
   // (note the duplicate status overwrites the one above, but they should be the same)
380 380
   Object.keys(challenge).forEach(function (key) {
381
-    auth[key] = challenge[key];
381
+    // don't confused devs with the id url
382
+    if ('url' === key) {
383
+      //auth.uri = challenge.url;
384
+    } else {
385
+      auth[key] = challenge[key];
386
+    }
382 387
   });
383 388
 
384 389
   // batteries-included helpers
385
-  auth.hostname = request.identifier.value;
390
+  auth.hostname = auth.identifier.value;
391
+  // because I'm not 100% clear if the wildcard identifier does or doesn't have the leading *. in all cases
392
+  auth.altname = ACME._untame(auth.identifier.value, auth.wildcard);
386 393
   auth.thumbprint = me.RSA.thumbprint(options.accountKeypair);
387 394
   //   keyAuthorization = token || '.' || base64url(JWK_Thumbprint(accountKey))
388 395
   auth.keyAuthorization = challenge.token + '.' + auth.thumbprint;
396
+  // conflicts with ACME challenge id url, if we ever decide to use it, but this just makes sense
397
+  // (as opposed to httpUrl or challengeUrl or uri, etc - I'd be happier to call the id url a uri)
398
+  auth.url = 'http://' + auth.identifier.value + ACME.challengePrefixes['http-01'] + '/' + auth.token;
389 399
   auth.dnsHost = dnsPrefix + '.' + auth.hostname.replace('*.', '');
390 400
   auth.dnsAuthorization = ACME._toWebsafeBase64(
391 401
     require('crypto').createHash('sha256').update(auth.keyAuthorization).digest('base64')
392 402
   );
393
-  // because I'm not 100% clear if the wildcard identifier does or doesn't have the leading *. in all cases
394
-  auth.altname = ACME._untame(request.identifier.value, request.wildcard);
395 403
 
396 404
   return auth;
397 405
 };

+ 4
- 4
package-lock.json View File

@@ -1,13 +1,13 @@
1 1
 {
2 2
   "name": "acme-v2",
3
-  "version": "1.5.3",
3
+  "version": "1.7.6",
4 4
   "lockfileVersion": 1,
5 5
   "requires": true,
6 6
   "dependencies": {
7 7
     "@coolaj86/urequest": {
8
-      "version": "1.3.6",
9
-      "resolved": "https://registry.npmjs.org/@coolaj86/urequest/-/urequest-1.3.6.tgz",
10
-      "integrity": "sha512-9rBXLFSb5D19opGeXdD/WuiFJsA4Pk2r8VUGEAeUZUxB1a2zB47K85BKAx3Gy9i4nZwg22ejlJA+q9DVrpQlbA=="
8
+      "version": "1.3.7",
9
+      "resolved": "https://registry.npmjs.org/@coolaj86/urequest/-/urequest-1.3.7.tgz",
10
+      "integrity": "sha512-PPrVYra9aWvZjSCKl/x1pJ9ZpXda1652oJrPBYy5rQumJJMkmTBN3ux+sK2xAUwVvv2wnewDlaQaHLxLwSHnIA=="
11 11
     },
12 12
     "eckles": {
13 13
       "version": "1.4.1",

+ 1
- 1
package.json View File

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "name": "acme-v2",
3
-  "version": "1.7.5",
3
+  "version": "1.7.6",
4 4
   "description": "Free SSL. A framework for building Let's Encrypt v2 clients, and other ACME v2 (draft 11) clients. Successor to le-acme-core.js",
5 5
   "homepage": "https://git.coolaj86.com/coolaj86/acme-v2.js",
6 6
   "main": "node.js",

Loading…
Cancel
Save