From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 793C71FF09B for ; Mon, 14 Sep 2026 18:19:47 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E19F721597; Mon, 14 Sep 2026 18:19:46 +0200 (CEST) From: Samuel Rufinatscha To: pdm-devel@lists.proxmox.com Subject: [PATCH proxmox 2/3] fix #7166: acme-api: allow stopping certificate orders Date: Mon, 14 Sep 2026 18:19:30 +0200 Message-ID: <20260914161931.380138-3-s.rufinatscha@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260914161931.380138-1-s.rufinatscha@proxmox.com> References: <20260914161931.380138-1-s.rufinatscha@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1789402769043 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.444 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: WGYZBOV4EI5TQVL75EPOHW4YOUXZFYA2 X-Message-ID-Hash: WGYZBOV4EI5TQVL75EPOHW4YOUXZFYA2 X-MailFrom: s.rufinatscha@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Handle abort requests during validation and finalization and clean up the challenge plugin when validation is stopped. Signed-off-by: Samuel Rufinatscha --- proxmox-acme-api/src/certificate_helpers.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/proxmox-acme-api/src/certificate_helpers.rs b/proxmox-acme-api/src/certificate_helpers.rs index 1db41564..771111fb 100644 --- a/proxmox-acme-api/src/certificate_helpers.rs +++ b/proxmox-acme-api/src/certificate_helpers.rs @@ -100,7 +100,11 @@ pub async fn order_certificate( .setup(&mut acme, &auth, domain_config, Arc::clone(&worker)) .await?; - let result = request_validation(&mut acme, auth_url, validation_url).await; + let result = tokio::select! { + biased; + _ = worker.abort_future() => Err(format_err!("abort requested - aborting task")), + result = request_validation(&mut acme, auth_url, validation_url) => result, + }; if let Err(err) = plugin_cfg .teardown(&mut acme, &auth, domain_config, Arc::clone(&worker)) @@ -119,7 +123,11 @@ pub async fn order_certificate( info!("Creating CSR"); let csr = proxmox_acme::util::Csr::generate(&identifiers, &Default::default())?; - let certificate = finalize_order(&mut acme, &order.location, &csr.data).await?; + let certificate = tokio::select! { + biased; + _ = worker.abort_future() => bail!("abort requested - aborting task"), + result = finalize_order(&mut acme, &order.location, &csr.data) => result?, + }; Ok(Some(OrderedCertificate { certificate, -- 2.47.3