public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Samuel Rufinatscha <s.rufinatscha@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [PATCH proxmox 3/3] fix #7166: acme-api: time out validation and finalization
Date: Mon, 14 Sep 2026 18:19:31 +0200	[thread overview]
Message-ID: <20260914161931.380138-4-s.rufinatscha@proxmox.com> (raw)
In-Reply-To: <20260914161931.380138-1-s.rufinatscha@proxmox.com>

Limit each domain's validation and order finalization to five minutes.
Start the validation timeout after plugin setup so DNS propagation waits
are unaffected, and clean up the plugin on timeout.

Signed-off-by: Samuel Rufinatscha <s.rufinatscha@proxmox.com>
---
 proxmox-acme-api/src/certificate_helpers.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/proxmox-acme-api/src/certificate_helpers.rs b/proxmox-acme-api/src/certificate_helpers.rs
index 771111fb..323f4b4a 100644
--- a/proxmox-acme-api/src/certificate_helpers.rs
+++ b/proxmox-acme-api/src/certificate_helpers.rs
@@ -16,6 +16,8 @@ use proxmox_rest_server::WorkerTask;
 use crate::CertificateInfo;
 use crate::types::{AcmeConfig, AcmeDomain};
 
+const ACME_POLL_TIMEOUT: Duration = Duration::from_secs(5 * 60);
+
 pub async fn revoke_certificate(acme_config: &AcmeConfig, certificate: &[u8]) -> Result<(), Error> {
     let mut acme = super::account_config::load_account_config(&acme_config.account)
         .await?
@@ -103,6 +105,9 @@ pub async fn order_certificate(
         let result = tokio::select! {
             biased;
             _ = worker.abort_future() => Err(format_err!("abort requested - aborting task")),
+            _ = tokio::time::sleep(ACME_POLL_TIMEOUT) => {
+                Err(format_err!("ACME validation for '{domain}' timed out"))
+            }
             result = request_validation(&mut acme, auth_url, validation_url) => result,
         };
 
@@ -126,6 +131,7 @@ pub async fn order_certificate(
     let certificate = tokio::select! {
         biased;
         _ = worker.abort_future() => bail!("abort requested - aborting task"),
+        _ = tokio::time::sleep(ACME_POLL_TIMEOUT) => bail!("ACME order finalization timed out"),
         result = finalize_order(&mut acme, &order.location, &csr.data) => result?,
     };
 
-- 
2.47.3





      parent reply	other threads:[~2026-09-14 16:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 16:19 [PATCH proxmox 0/3] fix #7166: acme: stop and time out stalled certificate orders Samuel Rufinatscha
2026-09-14 16:19 ` [PATCH proxmox 1/3] acme-api: extract certificate order finalization helper Samuel Rufinatscha
2026-09-14 16:19 ` [PATCH proxmox 2/3] fix #7166: acme-api: allow stopping certificate orders Samuel Rufinatscha
2026-09-14 16:19 ` Samuel Rufinatscha [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260914161931.380138-4-s.rufinatscha@proxmox.com \
    --to=s.rufinatscha@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal