diff --git a/acme4j-example/src/main/java/org/shredzone/acme4j/example/ClientTest.java b/acme4j-example/src/main/java/org/shredzone/acme4j/example/ClientTest.java index 8f3ffca5..178e5707 100644 --- a/acme4j-example/src/main/java/org/shredzone/acme4j/example/ClientTest.java +++ b/acme4j-example/src/main/java/org/shredzone/acme4j/example/ClientTest.java @@ -121,6 +121,7 @@ public class ClientTest { while (order.getStatus() != Status.VALID && attempts-- > 0) { // Did the order fail? if (order.getStatus() == Status.INVALID) { + LOG.error("Order has failed, reason: {}", order.getError()); throw new AcmeException("Order failed... Giving up."); } @@ -271,6 +272,7 @@ public class ClientTest { while (challenge.getStatus() != Status.VALID && attempts-- > 0) { // Did the authorization fail? if (challenge.getStatus() == Status.INVALID) { + LOG.error("Challenge has failed, reason: {}", challenge.getError()); throw new AcmeException("Challenge failed... Giving up."); } diff --git a/src/doc/docs/example.md b/src/doc/docs/example.md index a1b8ce5c..bf6f7ec6 100644 --- a/src/doc/docs/example.md +++ b/src/doc/docs/example.md @@ -102,6 +102,7 @@ public void fetchCertificate(Collection domains) while (order.getStatus() != Status.VALID && attempts-- > 0) { // Did the order fail? if (order.getStatus() == Status.INVALID) { + LOG.error("Order has failed, reason: {}", order.getError()); throw new AcmeException("Order failed... Giving up."); } @@ -260,6 +261,7 @@ private void authorize(Authorization auth) while (challenge.getStatus() != Status.VALID && attempts-- > 0) { // Did the authorization fail? if (challenge.getStatus() == Status.INVALID) { + LOG.error("Challenge has failed, reason: {}", challenge.getError()); throw new AcmeException("Challenge failed... Giving up."); } diff --git a/src/doc/docs/usage/order.md b/src/doc/docs/usage/order.md index c78f30d3..f346c6f6 100644 --- a/src/doc/docs/usage/order.md +++ b/src/doc/docs/usage/order.md @@ -16,11 +16,11 @@ Order order = account.newOrder() !!! note The number of domains per certificate may be limited. See your CA's documentation for the limits. -The `Order` resource contains a collection of `Authorization`s that can be read from the `getAuthorizations()` method. You must process _all of them_ in order to get the certificate, except those with a `VALID` status. +The `Order` resource contains a collection of `Authorization`s that can be read from the `getAuthorizations()` method. In order to get the certificate, you must process _all of them_ that are in a `PENDING` state. ```java for (Authorization auth : order.getAuthorizations()) { - if (auth.getStatus() != Status.VALID) { + if (auth.getStatus() == Status.PENDING) { processAuth(auth); } }