* the other callback

This commit is contained in:
AJ ONeal 2018-07-04 00:36:33 -06:00
parent 97e39aaeb0
commit 125d31b2c4
3 changed files with 12 additions and 11 deletions

1
.gitignore vendored
View File

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

20
node.js
View File

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

View File

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