mirror of https://github.com/shred/acme4j
Skip challenge if authorization is already valid
parent
d7c6ac659a
commit
b1ac68181c
|
@ -204,6 +204,11 @@ public class ClientTest {
|
||||||
private void authorize(Authorization auth) throws AcmeException {
|
private void authorize(Authorization auth) throws AcmeException {
|
||||||
LOG.info("Authorization for domain " + auth.getDomain());
|
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.
|
// Find the desired challenge and prepare it.
|
||||||
Challenge challenge = null;
|
Challenge challenge = null;
|
||||||
switch (CHALLENGE_TYPE) {
|
switch (CHALLENGE_TYPE) {
|
||||||
|
|
|
@ -122,6 +122,10 @@ public class OrderIT extends PebbleITBase {
|
||||||
assertThat(auth.getDomain(), is(domain));
|
assertThat(auth.getDomain(), is(domain));
|
||||||
assertThat(auth.getStatus(), is(Status.PENDING));
|
assertThat(auth.getStatus(), is(Status.PENDING));
|
||||||
|
|
||||||
|
if (auth.getStatus() == Status.VALID) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Challenge challenge = validator.prepare(auth);
|
Challenge challenge = validator.prepare(auth);
|
||||||
challenge.trigger();
|
challenge.trigger();
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,10 @@ public class OrderWildcardIT extends PebbleITBase {
|
||||||
assertThat(auth.getDomain(), is(TEST_DOMAIN));
|
assertThat(auth.getDomain(), is(TEST_DOMAIN));
|
||||||
assertThat(auth.getStatus(), is(Status.PENDING));
|
assertThat(auth.getStatus(), is(Status.PENDING));
|
||||||
|
|
||||||
|
if (auth.getStatus() == Status.VALID) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Dns01Challenge challenge = auth.findChallenge(Dns01Challenge.TYPE);
|
Dns01Challenge challenge = auth.findChallenge(Dns01Challenge.TYPE);
|
||||||
assertThat(challenge, is(notNullValue()));
|
assertThat(challenge, is(notNullValue()));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue