From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox 2/2] s3-client: add proxy configuration as optional client option
Date: Thu, 22 Jan 2026 16:11:21 +0100 [thread overview]
Message-ID: <20260122151125.832787-3-c.ebner@proxmox.com> (raw)
In-Reply-To: <20260122151125.832787-1-c.ebner@proxmox.com>
Allows to set a http proxy configuration for the client to be used for
the traffic from and to the s3 API endpoint.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
proxmox-s3-client/examples/s3_client.rs | 1 +
proxmox-s3-client/src/client.rs | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/proxmox-s3-client/examples/s3_client.rs b/proxmox-s3-client/examples/s3_client.rs
index ca69971c..df523c75 100644
--- a/proxmox-s3-client/examples/s3_client.rs
+++ b/proxmox-s3-client/examples/s3_client.rs
@@ -40,6 +40,7 @@ async fn run() -> Result<(), anyhow::Error> {
put_rate_limit: None,
provider_quirks: Vec::new(),
rate_limiter_config: None,
+ proxy_config: None,
};
// Creating a client instance and connect to api endpoint
diff --git a/proxmox-s3-client/src/client.rs b/proxmox-s3-client/src/client.rs
index 83176b39..25cc77c0 100644
--- a/proxmox-s3-client/src/client.rs
+++ b/proxmox-s3-client/src/client.rs
@@ -20,7 +20,7 @@ use openssl::x509::X509StoreContextRef;
use tracing::error;
use proxmox_http::client::HttpsConnector;
-use proxmox_http::Body;
+use proxmox_http::{Body, ProxyConfig};
use proxmox_rate_limiter::{RateLimit, RateLimiter, SharedRateLimiter};
use proxmox_schema::api_types::CERT_FINGERPRINT_SHA256_SCHEMA;
@@ -100,6 +100,8 @@ pub struct S3ClientOptions {
pub provider_quirks: Vec<ProviderQuirks>,
/// Configuration options for the shared rate limiter.
pub rate_limiter_config: Option<S3RateLimiterConfig>,
+ /// Proxy configuration to be used by the client.
+ pub proxy_config: Option<ProxyConfig>,
}
impl S3ClientOptions {
@@ -110,6 +112,7 @@ impl S3ClientOptions {
bucket: Option<String>,
common_prefix: String,
rate_limiter_options: Option<S3RateLimiterOptions>,
+ proxy_config: Option<ProxyConfig>,
) -> Self {
let rate_limiter_config = rate_limiter_options.map(|options| S3RateLimiterConfig {
options,
@@ -131,6 +134,7 @@ impl S3ClientOptions {
put_rate_limit: config.put_rate_limit,
provider_quirks: config.provider_quirks.unwrap_or_default(),
rate_limiter_config,
+ proxy_config,
}
}
}
@@ -213,6 +217,10 @@ impl S3Client {
}
}
+ if let Some(proxy_config) = &options.proxy_config {
+ https_connector.set_proxy(proxy_config.clone());
+ }
+
let client = Client::builder(TokioExecutor::new()).build::<_, Body>(https_connector);
let authority_template = if let Some(port) = options.port {
--
2.47.3
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2026-01-22 15:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 15:11 [pbs-devel] [PATCH proxmox{, -backup} 0/6] fix #6716: Add support for http proxy configuration for S3 endpoints Christian Ebner
2026-01-22 15:11 ` [pbs-devel] [PATCH proxmox 1/2] pbs-api-types: make operation non-optional for maintenance-mode check Christian Ebner
2026-01-22 15:11 ` Christian Ebner [this message]
2026-01-22 15:11 ` [pbs-devel] [PATCH proxmox-backup 1/4] datastore: make operation non-optional in lookups Christian Ebner
2026-01-22 15:11 ` [pbs-devel] [PATCH proxmox-backup 2/4] tools: factor out node proxy config read helper Christian Ebner
2026-01-22 15:11 ` [pbs-devel] [PATCH proxmox-backup 3/4] datastore: refactor datastore lookup parameters into dedicated type Christian Ebner
2026-01-22 15:11 ` [pbs-devel] [PATCH proxmox-backup 4/4] fix #6716: pass node http proxy config to s3 backend Christian Ebner
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=20260122151125.832787-3-c.ebner@proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pbs-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