Compare commits

..

No commits in common. "ba71e12ff2ae9e1b752d097b0a0dd363c0f7f217" and "2f0bf17b3972f1a857927d3801339535b87c0255" have entirely different histories.

2 changed files with 9 additions and 39 deletions

46
node.js
View File

@ -434,13 +434,15 @@ ACME._finalizeOrder = function (me, options, validatedDomains) {
, headers: { 'Content-Type': 'application/jose+json' }
, json: jws
}).then(function (resp) {
// https://tools.ietf.org/html/draft-ietf-acme-acme-12#section-7.1.3
// Possible values are: "pending" => ("invalid" || "ready") => "processing" => "valid"
me._nonce = resp.toJSON().headers['replay-nonce'];
if (me.debug) console.debug('order finalized: resp.body:');
if (me.debug) console.debug(resp.body);
if ('processing' === resp.body.status) {
return ACME._wait().then(pollCert);
}
if ('valid' === resp.body.status) {
me._expires = resp.body.expires;
me._certificate = resp.body.certificate;
@ -448,45 +450,13 @@ ACME._finalizeOrder = function (me, options, validatedDomains) {
return resp.body;
}
if ('processing' === resp.body.status) {
return ACME._wait().then(pollCert);
}
if (me.debug) console.debug("Error: bad status:\n" + JSON.stringify(resp.body, null, 2));
if ('pending' === resp.body.status) {
return Promise.reject(new Error(
"Did not finalize order: status 'pending'."
+ " Best guess: You have not accepted at least one challenge for each domain." + "\n\n"
+ JSON.stringify(resp.body, null, 2)
));
}
if ('invalid' === resp.body.status) {
return Promise.reject(new Error(
"Did not finalize order: status 'invalid'."
+ " Best guess: One or more of the domain challenges could not be verified"
+ " (or the order was canceled)." + "\n\n"
+ JSON.stringify(resp.body, null, 2)
));
console.error('cannot finalize: badness');
return;
}
if ('ready' === resp.body.status) {
return Promise.reject(new Error(
"Did not finalize order: status 'ready'."
+ " Hmmm... this state shouldn't be possible here. That was the last state."
+ " This one should at least be 'processing'." + "\n\n"
+ JSON.stringify(resp.body, null, 2) + "\n\n"
+ "Please open an issue at https://git.coolaj86.com/coolaj86/acme-v2.js"
));
}
return Promise.reject(new Error(
"Didn't finalize order: Unhandled status '" + resp.body.status + "'."
+ " This is not one of the known statuses...\n\n"
+ JSON.stringify(resp.body, null, 2) + "\n\n"
+ "Please open an issue at https://git.coolaj86.com/coolaj86/acme-v2.js"
));
console.error('(x) cannot finalize: badness');
return;
});
}

View File

@ -1,6 +1,6 @@
{
"name": "acme-v2",
"version": "1.0.6",
"version": "1.0.5",
"description": "Free SSL. A framework for building Let's Encrypt v2 clients, and other ACME v2 (draft 11) clients. Successor to le-acme-core.js",
"homepage": "https://git.coolaj86.com/coolaj86/acme-v2.js",
"main": "node.js",