forked from root/acme.js
* the other callback
This commit is contained in:
parent
6c811d880c
commit
0a5a72e2fc
|
@ -1,3 +1,4 @@
|
|||
*.pem
|
||||
letsencrypt.work
|
||||
letsencrypt.logs
|
||||
letsencrypt.config
|
||||
|
|
20
node.js
20
node.js
|
@ -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);
|
||||
|
|
|
@ -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