Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 7 additions & 17 deletions test/chisel2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import sys
import signal
import threading
import time

from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography import x509
Expand Down Expand Up @@ -140,21 +138,13 @@ def auth_and_issue(domains, chall_type="dns-01", email=None, cert_output=None, c
else:
raise Exception("invalid challenge type %s" % chall_type)

# Make up to three attempts, retrying on badNonce errors
for n in range(3):
time.sleep(0.2 * n) # No sleep before the first attempt, then backoff
try:
order = client.poll_and_finalize(order)
if cert_output is not None:
with open(cert_output, "w") as f:
f.write(order.fullchain_pem)
except messages.Error as e:
if e.typ == "urn:ietf:params:acme:error:badNonce":
continue
else:
break
finally:
cleanup()
try:
order = client.poll_and_finalize(order)
if cert_output is not None:
with open(cert_output, "w") as f:
f.write(order.fullchain_pem)
finally:
cleanup()

return order

Expand Down
2 changes: 1 addition & 1 deletion test/config-next/nonce-a.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"sampleratio": 1
},
"grpc": {
"maxConnectionAge": "30s",
"maxConnectionAge": "30m",
"services": {
"nonce.NonceService": {
"clientNames": [
Expand Down
2 changes: 1 addition & 1 deletion test/config-next/nonce-b.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"sampleratio": 1
},
"grpc": {
"maxConnectionAge": "30s",
"maxConnectionAge": "30m",
"services": {
"nonce.NonceService": {
"clientNames": [
Expand Down
2 changes: 1 addition & 1 deletion test/config/nonce-a.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"debugAddr": ":8111",
"grpc": {
"maxConnectionAge": "30s",
"maxConnectionAge": "30m",
"address": ":9101",
"services": {
"nonce.NonceService": {
Expand Down
2 changes: 1 addition & 1 deletion test/config/nonce-b.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"debugAddr": ":8111",
"grpc": {
"maxConnectionAge": "30s",
"maxConnectionAge": "30m",
"address": ":9101",
"services": {
"nonce.NonceService": {
Expand Down
Loading