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 199891FF0AF for ; Thu, 08 Oct 2026 17:33:38 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B270B213A5; Thu, 08 Oct 2026 17:33:37 +0200 (CEST) From: Samuel Rufinatscha To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox 1/2] acme: async_client: support HTTP proxies Date: Thu, 8 Oct 2026 17:33:19 +0200 Message-ID: <20261008153323.293158-2-s.rufinatscha@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261008153323.293158-1-s.rufinatscha@proxmox.com> References: <20261008153323.293158-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: 1791473608111 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.286 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: W624FJLICWSTZ466YNK77M3J5GDKYVND X-Message-ID-Hash: W624FJLICWSTZ466YNK77M3J5GDKYVND 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 Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add a constructor that passes an optional proxy configuration to the HTTP transport. Signed-off-by: Samuel Rufinatscha --- proxmox-acme/src/async_client.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/proxmox-acme/src/async_client.rs b/proxmox-acme/src/async_client.rs index bba92023..6df2737d 100644 --- a/proxmox-acme/src/async_client.rs +++ b/proxmox-acme/src/async_client.rs @@ -6,7 +6,7 @@ use http_body_util::BodyExt; use hyper::Request; use serde::{Deserialize, Serialize}; -use proxmox_http::{Body, client::Client}; +use proxmox_http::{Body, ProxyConfig, client::Client}; use crate::Request as AcmeRequest; use crate::account::AccountCreator; @@ -25,11 +25,16 @@ pub struct AcmeClient { impl AcmeClient { /// Create a new ACME client for a given ACME directory URL. pub fn new(directory_url: String) -> Self { + Self::with_proxy(directory_url, None) + } + + /// Create a new ACME client with an optional HTTP proxy. + pub fn with_proxy(directory_url: String, proxy_config: Option) -> Self { const USER_AGENT_STRING: &str = "proxmox-acme-client/1.0"; const TCP_KEEPALIVE_TIME: u32 = 120; let options = proxmox_http::HttpOptions { - proxy_config: None, // fixme??? + proxy_config, user_agent: Some(USER_AGENT_STRING.to_string()), tcp_keepalive: Some(TCP_KEEPALIVE_TIME), }; -- 2.47.3