Browse Source

* the other callback

pull/25/head v1.1.1
AJ ONeal 6 years ago
parent
commit
125d31b2c4
  1. 1
      .gitignore
  2. 12
      node.js
  3. 2
      tests/compat.js

1
.gitignore

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

12
node.js

@ -416,25 +416,25 @@ ACME._postChallenge = function (me, options, identifier, ch) {
if (1 === options.setChallenge.length) { if (1 === options.setChallenge.length) {
options.setChallenge(auth).then(testChallenge).then(resolve, reject); options.setChallenge(auth).then(testChallenge).then(resolve, reject);
} else if (2 === options.setChallenge.length) { } else if (2 === options.setChallenge.length) {
var challengeCb = function (err) { options.setChallenge(auth, function (err) {
if(err) { if(err) {
reject(err); reject(err);
} else { } else {
testChallenge().then(resolve, reject); testChallenge().then(resolve, reject);
} }
};
Object.keys(auth).forEach(function (key) {
challengeCb[key] = auth[key];
}); });
options.setChallenge(auth, challengeCb);
} else { } else {
options.setChallenge(identifier.value, ch.token, keyAuthorization, function(err) { var challengeCb = function(err) {
if(err) { if(err) {
reject(err); reject(err);
} else { } else {
testChallenge().then(resolve, reject); testChallenge().then(resolve, reject);
} }
};
Object.keys(auth).forEach(function (key) {
challengeCb[key] = auth[key];
}); });
options.setChallenge(identifier.value, ch.token, keyAuthorization, challengeCb);
} }
} catch(e) { } catch(e) {
reject(e); reject(e);

2
tests/compat.js

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

Loading…
Cancel
Save