mirror of https://github.com/shred/acme4j
Fix possible NPE
parent
576a798186
commit
c19a6ad1a4
|
@ -339,21 +339,21 @@ public class DefaultConnection implements Connection {
|
||||||
Objects.requireNonNull(accept, "accept");
|
Objects.requireNonNull(accept, "accept");
|
||||||
assertConnectionIsClosed();
|
assertConnectionIsClosed();
|
||||||
|
|
||||||
AcmeException lastException = null;
|
int attempt = 1;
|
||||||
|
while (true) {
|
||||||
for (int attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
|
|
||||||
try {
|
try {
|
||||||
return performRequest(url, claims, session, keypair, accountLocation, accept);
|
return performRequest(url, claims, session, keypair, accountLocation, accept);
|
||||||
} catch (AcmeServerException ex) {
|
} catch (AcmeServerException ex) {
|
||||||
if (!BAD_NONCE_ERROR.equals(ex.getType())) {
|
if (!BAD_NONCE_ERROR.equals(ex.getType())) {
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
lastException = ex;
|
if (attempt == MAX_ATTEMPTS) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
LOG.info("Bad Replay Nonce, trying again (attempt {}/{})", attempt, MAX_ATTEMPTS);
|
LOG.info("Bad Replay Nonce, trying again (attempt {}/{})", attempt, MAX_ATTEMPTS);
|
||||||
|
attempt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw lastException;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue