retry on bad nonce
This commit is contained in:
parent
43ccd091b2
commit
4f9173eb4a
|
@ -2704,6 +2704,16 @@ ACME._jwsRequest = function (me, bigopts) {
|
||||||
//#console.debug('[acme-v2] ' + bigopts.url + ':');
|
//#console.debug('[acme-v2] ' + bigopts.url + ':');
|
||||||
//#console.debug(jws);
|
//#console.debug(jws);
|
||||||
return ACME._request(me, { url: bigopts.url, json: jws });
|
return ACME._request(me, { url: bigopts.url, json: jws });
|
||||||
|
}).catch(function (e) {
|
||||||
|
if (/badNonce$/.test(e.urn)) {
|
||||||
|
// retry badNonces
|
||||||
|
var retryable = (bigopts._retries >= 2);
|
||||||
|
if (!retryable) {
|
||||||
|
bigopts._retries = (bigopts._retries || 0) + 1;
|
||||||
|
return ACME._jwsRequest(me, bigopts);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue