Handle unnaceptable nonce values
This commit is contained in:
parent
a060ecd130
commit
fe96e94e06
24
node.js
24
node.js
|
@ -1001,6 +1001,18 @@ ACME._finalizeOrder = function(me, options, validatedDomains) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The documented ACME error code is "urn:ietf:params:acme:error:badNonce"
|
||||||
|
// however some servers historically have done their variations, so just check `:badnonce`.
|
||||||
|
// https://tools.ietf.org/html/rfc8555#section-6.5
|
||||||
|
if (resp.body.type.toLowerCase().endsWith(':badnonce')) {
|
||||||
|
if (me.debug) {
|
||||||
|
console.debug('[acme-v2] Nonce value unacceptable; retrying with a new nonce');
|
||||||
|
}
|
||||||
|
|
||||||
|
// `me._nonce` has been reset earlier in this function, so just call `poll` again.
|
||||||
|
return pollCert();
|
||||||
|
}
|
||||||
|
|
||||||
return Promise.reject(
|
return Promise.reject(
|
||||||
new Error(
|
new Error(
|
||||||
"Didn't finalize order: Unhandled status '" +
|
"Didn't finalize order: Unhandled status '" +
|
||||||
|
@ -1176,6 +1188,18 @@ ACME._getCertificate = function(me, options) {
|
||||||
//if (me.debug) console.debug('[DEBUG] finalize:', me._finalize); return;
|
//if (me.debug) console.debug('[DEBUG] finalize:', me._finalize); return;
|
||||||
|
|
||||||
if (!me._authorizations) {
|
if (!me._authorizations) {
|
||||||
|
// The documented ACME error code is "urn:ietf:params:acme:error:badNonce"
|
||||||
|
// however some servers historically have done their variations, so just check `:badnonce`.
|
||||||
|
// https://tools.ietf.org/html/rfc8555#section-6.5
|
||||||
|
if (resp.body.type.toLowerCase().endsWith(':badnonce')) {
|
||||||
|
if (me.debug) {
|
||||||
|
console.debug('[acme-v2] Nonce value unacceptable; retrying with a new nonce');
|
||||||
|
}
|
||||||
|
|
||||||
|
// `me._nonce` has been reset earlier in this function, so just call `get` again.
|
||||||
|
return ACME._getCertificate(me, options);
|
||||||
|
}
|
||||||
|
|
||||||
return Promise.reject(
|
return Promise.reject(
|
||||||
new Error(
|
new Error(
|
||||||
"[acme-v2.js] authorizations were not fetched for '" +
|
"[acme-v2.js] authorizations were not fetched for '" +
|
||||||
|
|
Loading…
Reference in New Issue