rust-s3: Accessing s3 bucket using `tokio-rustls-tls` returns 403 error
Describe the bug
When trying to access s3 bucket using the tokio-rustls-tls feature, it is returning 403 (Access denied) as response for head_object() request. The same request succeeded when tokio-native-tls was used.
To Reproduce
- Include
tokio-rustls-tlsfeature
rust-s3 = { version = "0.32", default-features = false, features = [
"tokio-native-tls",
"tags"
] }
- Create a bucket with appropriate credentials
let bucket = Bucket::new(
"my_bucket",
Region::Custom {
endpoint: "my_endpoint",
region: "my_region",
},
Credentials::new(
Some("my_key"),
Some("my_secret"),
None,
None,
None,
)
.context("unable to create credentials")?,
)
.context("unable to create bucket")?;
- Invoke the
head_object()request
let (head, code) = bucket.head_object(&file).await?;
Expected behavior
- The expected
codewas 200 but got 403 - Same request using
tokio-native-tlsreturned 200code
Environment
- Rust version: [e.g.
1.63] - lib version [e.g.
0.32]
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 16 (6 by maintainers)
One issue I had with Rustls is the bucket having periods in its name, which triggered https://github.com/rustls/rustls/issues/184
I’ve added this as a feature on my branch, gonna test in a minute once it builds