Browse Source

retry on bad nonce

master
AJ ONeal 3 months ago
parent
commit
137990002a
1 changed files with 10 additions and 0 deletions
  1. 10
    0
      app/js/bluecrypt-acme.js

+ 10
- 0
app/js/bluecrypt-acme.js View File

@@ -2704,6 +2704,16 @@ ACME._jwsRequest = function (me, bigopts) {
2704 2704
       //#console.debug('[acme-v2] ' + bigopts.url + ':');
2705 2705
       //#console.debug(jws);
2706 2706
       return ACME._request(me, { url: bigopts.url, json: jws });
2707
+    }).catch(function (e) {
2708
+      if (/badNonce$/.test(e.urn)) {
2709
+        // retry badNonces
2710
+        var retryable = (bigopts._retries >= 2);
2711
+        if (!retryable) {
2712
+          bigopts._retries = (bigopts._retries || 0) + 1;
2713
+          return ACME._jwsRequest(me, bigopts);
2714
+        }
2715
+      }
2716
+      throw e;
2707 2717
     });
2708 2718
   });
2709 2719
 };

Loading…
Cancel
Save