Skip challenge if authorization is already valid

pull/61/head
Richard Körber 2018-02-21 19:58:29 +01:00
parent d7c6ac659a
commit b1ac68181c
No known key found for this signature in database
GPG Key ID: AAB9FD19C78AA3E0
3 changed files with 13 additions and 0 deletions

View File

@ -204,6 +204,11 @@ public class ClientTest {
private void authorize(Authorization auth) throws AcmeException {
LOG.info("Authorization for domain " + auth.getDomain());
// The authorization is already valid. No need to process a challenge.
if (auth.getStatus() == Status.VALID) {
return;
}
// Find the desired challenge and prepare it.
Challenge challenge = null;
switch (CHALLENGE_TYPE) {

View File

@ -122,6 +122,10 @@ public class OrderIT extends PebbleITBase {
assertThat(auth.getDomain(), is(domain));
assertThat(auth.getStatus(), is(Status.PENDING));
if (auth.getStatus() == Status.VALID) {
continue;
}
Challenge challenge = validator.prepare(auth);
challenge.trigger();

View File

@ -80,6 +80,10 @@ public class OrderWildcardIT extends PebbleITBase {
assertThat(auth.getDomain(), is(TEST_DOMAIN));
assertThat(auth.getStatus(), is(Status.PENDING));
if (auth.getStatus() == Status.VALID) {
continue;
}
Dns01Challenge challenge = auth.findChallenge(Dns01Challenge.TYPE);
assertThat(challenge, is(notNullValue()));