Skip to content

Use path-style URL in resolve_bucket_region for dotted bucket names#752

Merged
alamb merged 1 commit into
apache:mainfrom
brankogrb-db:fix/resolve-bucket-region-dotted-names
Jun 15, 2026
Merged

Use path-style URL in resolve_bucket_region for dotted bucket names#752
alamb merged 1 commit into
apache:mainfrom
brankogrb-db:fix/resolve-bucket-region-dotted-names

Conversation

@brankogrb-db

@brankogrb-db brankogrb-db commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

resolve_bucket_region unconditionally uses virtual-hosted-style URLs ({bucket}.s3.amazonaws.com). When the bucket name contains dots, this produces a hostname that doesn't match S3's *.s3.amazonaws.com wildcard TLS certificate (wildcards only cover a single DNS label), causing the TLS handshake to fail.

This PR falls back to path-style (s3.amazonaws.com/{bucket}) when the bucket name contains a dot — the same heuristic the official AWS SDKs use.

@brankogrb-db brankogrb-db changed the title Use path-style URL in resolve_bucket_region for dotted bucket names Use path-style URL in resolve_bucket_region for dotted bucket names Jun 15, 2026
S3's wildcard TLS cert (*.s3.amazonaws.com) only covers one DNS
label. Use path-style for bucket names containing dots.

Closes apache#747
@brankogrb-db
brankogrb-db force-pushed the fix/resolve-bucket-region-dotted-names branch from 5e459f7 to 1fbd90e Compare June 15, 2026 08:40
@alamb
alamb merged commit 49a7125 into apache:main Jun 15, 2026
9 checks passed
@alamb

alamb commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Thank you @brankogrb-db and @kylebarron

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

resolve_bucket_region fails TLS handshake for bucket names containing dots

3 participants