Skip to content

Commit

Permalink
PR 357, ACME order processing, handle errors
Browse files Browse the repository at this point in the history
When waiting for an ACME order to process to its stages and an error
occured, add information to the result collection at what stage of
processing the order failed.

refs #351
  • Loading branch information
icing committed Jan 15, 2025
1 parent 04c847e commit 50c8bc8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/md_acmev2_drive.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,17 @@ apr_status_t md_acmev2_drive_renew(md_acme_driver_t *ad, md_proto_driver_t *d, m

rv = md_acme_order_monitor_authzs(ad->order, ad->acme, d->md,
ad->authz_monitor_timeout, result, d->p);
if (APR_SUCCESS != rv) goto leave;
if (APR_SUCCESS != rv) {
md_result_set(result, rv, "Error waiting on domain names to be validated");
goto leave;
}

rv = md_acme_order_await_ready(ad->order, ad->acme, d->md,
ad->authz_monitor_timeout, result, d->p);
if (APR_SUCCESS != rv) goto leave;
if (APR_SUCCESS != rv) {
md_result_set(result, rv, "Error waiting for order to become ready");
goto leave;
}

if (MD_ACME_ORDER_ST_READY == ad->order->status) {
rv = md_acme_drive_setup_cred_chain(d, result);
Expand All @@ -166,7 +172,10 @@ apr_status_t md_acmev2_drive_renew(md_acme_driver_t *ad, md_proto_driver_t *d, m

rv = md_acme_order_await_valid(ad->order, ad->acme, d->md,
ad->authz_monitor_timeout, result, d->p);
if (APR_SUCCESS != rv) goto leave;
if (APR_SUCCESS != rv) {
md_result_set(result, rv, "Error waiting for order to become valid.");
goto leave;
}

if (!ad->order->certificate) {
md_result_set(result, APR_EINVAL, "Order valid, but certificate url is missing.");
Expand Down

0 comments on commit 50c8bc8

Please sign in to comment.