improve error message as per https://git.coolaj86.com/coolaj86/greenlock.js/issues/12
This commit is contained in:
parent
d0745a6347
commit
bfff22f053
19
node.js
19
node.js
|
@ -22,15 +22,20 @@ ACME.challengeTests = {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = new Error("self check does not pass");
|
err = new Error(
|
||||||
err.code = 'E_RETRY';
|
"Error: Failed HTTP-01 Dry Run.\n"
|
||||||
|
+ "curl '" + url + "' does not return '" + auth.keyAuthorization + "'\n"
|
||||||
|
+ "See https://git.coolaj86.com/coolaj86/acme-v2.js/issues/4"
|
||||||
|
);
|
||||||
|
err.code = 'E_FAIL_DRY_CHALLENGE';
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
, 'dns-01': function (me, auth) {
|
, 'dns-01': function (me, auth) {
|
||||||
|
var hostname = ACME.challengePrefixes['dns-01'] + '.' + auth.hostname;
|
||||||
return me._dig({
|
return me._dig({
|
||||||
type: 'TXT'
|
type: 'TXT'
|
||||||
, name: ACME.challengePrefixes['dns-01'] + '.' + auth.hostname
|
, name: hostname
|
||||||
}).then(function (ans) {
|
}).then(function (ans) {
|
||||||
var err;
|
var err;
|
||||||
|
|
||||||
|
@ -40,8 +45,12 @@ ACME.challengeTests = {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = new Error("self check does not pass");
|
err = new Error(
|
||||||
err.code = 'E_RETRY';
|
"Error: Failed DNS-01 Dry Run.\n"
|
||||||
|
+ "dig TXT '" + hostname + "' does not return '" + auth.dnsAuthorization + "'\n"
|
||||||
|
+ "See https://git.coolaj86.com/coolaj86/acme-v2.js/issues/4"
|
||||||
|
);
|
||||||
|
err.code = 'E_FAIL_DRY_CHALLENGE';
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue