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-tls feature
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 code was 200 but got 403
  • Same request using tokio-native-tls returned 200 code

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)

Most upvoted comments

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