* the other callback
This commit is contained in:
parent
97e39aaeb0
commit
125d31b2c4
|
@ -1,3 +1,4 @@
|
|||
*.pem
|
||||
letsencrypt.work
|
||||
letsencrypt.logs
|
||||
letsencrypt.config
|
||||
|
|
18
node.js
18
node.js
|
@ -416,6 +416,14 @@ 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) {
|
||||
options.setChallenge(auth, function (err) {
|
||||
if(err) {
|
||||
reject(err);
|
||||
} else {
|
||||
testChallenge().then(resolve, reject);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
var challengeCb = function(err) {
|
||||
if(err) {
|
||||
reject(err);
|
||||
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue