This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs-object-store.git
The following commit(s) were added to refs/heads/main by this push:
new 49a7125 Use path-style URL in resolve_bucket_region for dotted bucket
names (#752)
49a7125 is described below
commit 49a71257721b103b50ca02efa838ce0fc7d65f75
Author: brankogrb-db <[email protected]>
AuthorDate: Mon Jun 15 20:15:08 2026 +0200
Use path-style URL in resolve_bucket_region for dotted bucket names (#752)
S3's wildcard TLS cert (*.s3.amazonaws.com) only covers one DNS
label. Use path-style for bucket names containing dots.
Closes #747
---
src/aws/resolve.rs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/aws/resolve.rs b/src/aws/resolve.rs
index a09ea53..fdc9576 100644
--- a/src/aws/resolve.rs
+++ b/src/aws/resolve.rs
@@ -49,7 +49,12 @@ impl From<Error> for crate::Error {
pub async fn resolve_bucket_region(bucket: &str, client_options:
&ClientOptions) -> Result<String> {
use http::StatusCode;
- let endpoint = format!("https://{bucket}.s3.amazonaws.com");
+ // S3's wildcard TLS cert (*.s3.amazonaws.com) only covers one DNS label.
Use path-style for dotted names.
+ let endpoint = if bucket.contains('.') {
+ format!("https://s3.amazonaws.com/{bucket}")
+ } else {
+ format!("https://{bucket}.s3.amazonaws.com")
+ };
let client = client_options.client()?;