handle setChallenge failure
This commit is contained in:
parent
7eace7e37e
commit
e0202a559e
|
@ -166,7 +166,18 @@ module.exports.create = function (deps) {
|
|||
|
||||
options.setChallenge(state.domain, challenge.token, keyAuthorization, challengeDone);
|
||||
|
||||
function challengeDone() {
|
||||
function challengeDone(err) {
|
||||
if (err) {
|
||||
console.error('[letiny-core] setChallenge Error:');
|
||||
console.error(err && err.stack || err);
|
||||
ensureValidation(err, null, null, function () {
|
||||
options.removeChallenge(state.domain, challenge.token, function () {
|
||||
// ignore
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
state.acme.post(state.responseUrl, {
|
||||
resource:'challenge',
|
||||
keyAuthorization:keyAuthorization
|
||||
|
@ -193,7 +204,8 @@ module.exports.create = function (deps) {
|
|||
|
||||
if (err || Math.floor(res.statusCode/100)!==2) {
|
||||
unlink();
|
||||
return handleErr(err, 'Authorization status request failed ('+res.statusCode+')');
|
||||
return handleErr(err, 'Authorization status request failed ('
|
||||
+ (res && res.statusCode || err.code || err.message || err) + ')');
|
||||
}
|
||||
|
||||
authz=body;
|
||||
|
|
Loading…
Reference in New Issue