From: William Lallemand Date: Wed, 16 Apr 2025 12:03:08 +0000 (+0200) Subject: Revert "BUG/MINOR: acme: key not restored upon error in acme_res_certificate()" X-Git-Tag: v3.2-dev11~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e21a165af68f4c9a91b5d1ba37a26780257a880c;p=thirdparty%2Fhaproxy.git Revert "BUG/MINOR: acme: key not restored upon error in acme_res_certificate()" This reverts commit 7a43094f8d8fe3c435ecc003f07453dd9de8134a. Part of another incomplete patch was accidentally squash into the patch. --- diff --git a/src/acme.c b/src/acme.c index 044a8d6a0..2e427ebe5 100644 --- a/src/acme.c +++ b/src/acme.c @@ -638,7 +638,7 @@ int acme_res_certificate(struct task *task, struct acme_ctx *ctx, char **errmsg) struct http_hdr *hdrs, *hdr; struct buffer *t1 = NULL, *t2 = NULL; int ret = 1; - EVP_PKEY *key = NULL; + EVP_PKEY *key; hc = ctx->hc; if (!hc) @@ -681,7 +681,6 @@ int acme_res_certificate(struct task *task, struct acme_ctx *ctx, char **errmsg) /* restore the key */ ctx->store->data->key = key; - key = NULL; if (acme_update_certificate(task, ctx, errmsg) != 0) goto error; @@ -690,8 +689,6 @@ out: ret = 0; error: - if (key) - ctx->store->data->key = key; free_trash_chunk(t1); free_trash_chunk(t2); httpclient_destroy(hc); @@ -1679,9 +1676,9 @@ retry: int i; for (i = 0; i < ACME_RETRY - ctx->retries; i++) - delay *= 3; + delay *= 3000; ha_notice("acme: %s, retrying in %dms (%d/%d)...\n", errmsg ? errmsg : "", delay, ACME_RETRY-ctx->retries, ACME_RETRY); - task->expire = tick_add(now_ms, delay * 1000); + task->expire = tick_add(now_ms, delay); } else { ha_notice("acme: %s, aborting. (%d/%d)\n", errmsg ? errmsg : "", ACME_RETRY-ctx->retries, ACME_RETRY);