Browse Source

* the other callback

tags/v1.1.1
AJ ONeal 11 months ago
parent
commit
125d31b2c4
3 changed files with 8 additions and 7 deletions
  1. 1
    0
      .gitignore
  2. 6
    6
      node.js
  3. 1
    1
      tests/compat.js

+ 1
- 0
.gitignore View File

@@ -1,3 +1,4 @@
1
+*.pem
1 2
 letsencrypt.work
2 3
 letsencrypt.logs
3 4
 letsencrypt.config

+ 6
- 6
node.js View File

@@ -416,25 +416,25 @@ ACME._postChallenge = function (me, options, identifier, ch) {
416 416
       if (1 === options.setChallenge.length) {
417 417
         options.setChallenge(auth).then(testChallenge).then(resolve, reject);
418 418
       } else if (2 === options.setChallenge.length) {
419
-        var challengeCb = function (err) {
419
+        options.setChallenge(auth, function (err) {
420 420
           if(err) {
421 421
             reject(err);
422 422
           } else {
423 423
             testChallenge().then(resolve, reject);
424 424
           }
425
-        };
426
-        Object.keys(auth).forEach(function (key) {
427
-          challengeCb[key] = auth[key];
428 425
         });
429
-        options.setChallenge(auth, challengeCb);
430 426
       } else {
431
-        options.setChallenge(identifier.value, ch.token, keyAuthorization, function(err) {
427
+        var challengeCb = function(err) {
432 428
           if(err) {
433 429
             reject(err);
434 430
           } else {
435 431
             testChallenge().then(resolve, reject);
436 432
           }
433
+        };
434
+        Object.keys(auth).forEach(function (key) {
435
+          challengeCb[key] = auth[key];
437 436
         });
437
+        options.setChallenge(identifier.value, ch.token, keyAuthorization, challengeCb);
438 438
       }
439 439
     } catch(e) {
440 440
       reject(e);

+ 1
- 1
tests/compat.js View File

@@ -26,7 +26,7 @@ module.exports.run = function (directoryUrl, RSA, web, chType, email, accountKey
26 26
           console.log("dig TXT " + pathname + " '" + cb.dnsAuthorization + "'");
27 27
           console.log("\nThen hit the 'any' key to continue...");
28 28
         } else {
29
-          cb(new Error("[acme-v2] unrecognized challenge type"));
29
+          cb(new Error("[acme-v2] unrecognized challenge type: " + cb.type));
30 30
           return;
31 31
         }
32 32
 

Loading…
Cancel
Save