From 4f9173eb4aa2532112d9096c03de186447b3f355 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 28 May 2019 05:15:46 -0600 Subject: [PATCH] retry on bad nonce --- app/js/bluecrypt-acme.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/js/bluecrypt-acme.js b/app/js/bluecrypt-acme.js index b229863..0744c8e 100644 --- a/app/js/bluecrypt-acme.js +++ b/app/js/bluecrypt-acme.js @@ -2704,6 +2704,16 @@ ACME._jwsRequest = function (me, bigopts) { //#console.debug('[acme-v2] ' + bigopts.url + ':'); //#console.debug(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; }); }); };