-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
default_http_client called even if http_client is provided #965
Comments
Hi @utterstep, thank you for reporting this! Appreciate spending time adding the backtrace and call chains to make the description so much easier to understand. As you pointed out above, the issue seems that our default Please note that We'll add this to our backlog to come up with a fix. |
can you try disabling default features? That should remove the default http client. You will need to re-enable the other default features. |
Hi, @rcoh! I use this feature to be able to use async fn aws_sdk_config() -> SdkConfig {
// Rustls connector.
let rustls_connector = hyper_rustls::HttpsConnectorBuilder::new()
.with_webpki_roots()
.https_only()
.enable_http1()
.enable_http2()
.build();
// Hyper client builder.
let http_client = HyperClientBuilder::new().build(rustls_connector);
aws_config::from_env()
.http_client(http_client)
.region(EnvironmentVariableRegionProvider::new())
.credentials_provider(EnvironmentVariableCredentialsProvider::new())
.load()
.await
} |
ah! Yeah we need to split those up. We'll get this fixed |
hmm, we're having a hard time reproducing this. Can you send your Cargo.toml? |
@rcoh sure :) Tried to minimize example, see this repo: In Cargo.lock you can see that [[package]]
name = "hyper-rustls"
version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590"
dependencies = [
"futures-util",
"http",
"hyper",
"log",
"rustls",
"rustls-native-certs",
"tokio",
"tokio-rustls",
"webpki-roots",
] |
Thanks for putting that together! I think I see what's causing the issue for you. There are two things:
aws-config = { version = "1", default-features = false, features = ["rt-tokio", "behavior-version-latest"] }
aws-sdk-ec2 = { version = "0.39", default-features = false, features = ["rt-tokio", "behavior-version-latest"] }
aws-sdk-s3 = { version = "0.39", default-features = false, features = ["rt-tokio", "behavior-version-latest"] }
aws-smithy-runtime = { version = "1", default-features = false, features = ["client", "connector-hyper-0-14-x"] } When I make those changes in to aws-sdk-certs-reproduction repo, I see that rustls-native-certs is no longer in the Cargo.lock. |
Geez, sorry for the typo :( It's a bit counter-intuitive, disabling And many thanks to you and the team! :) |
Yeah, that's exactly it. |
|
Describe the bug
I'm using
aws-sdk-s3
with customhttp_client
, to usewebpki_roots
instead of system CA certificates, creating config this way:However, when I then create
aws_sdk_s3::Client
from config:I get the following error in my production environment:
**Backtrace**
And yeah, that's right, I don't have system-provided CA-certificates, that's why I'm creating custom
http_client
withwith_webpki_roots
:)If I'm looking at it correctly, the error originates from:
aws_sdk_s3::Client::from_conf
->
aws_sdk_s3::config::base_client_runtime_plugins
->
aws_smithy_runtime::client::defaults::default_plugins()
->
aws_smithy_runtime::client::defaults::default_http_client_plugin
which, in case you have
connector-hyper-0-14-x
feature enabled (which I do to be able to useHyperClientBuilder
) creates hyper client.And
aws_smithy_runtime
depends onhyper-rustls
withnative-certs
unconditionally, which triggers it to try find some native certs, leading to runtime panic I'm experiencing.Expected Behavior
No panic, basically :)
Current Behavior
Panic
Reproduction Steps
Run
on a machine without system CA certificates (Docker image
debian:bookworm-slim
, for example).Possible Solution
Maybe do not create
default_http_client
when being provided with one?Or, another way would be to allow to configure
hyper-rustls
dependency ofaws-smithy-runtime
to usewebpki-roots
.Additional Information/Context
No response
Version
Environment details (OS name and version, etc.)
debian:bookworm-slim
Docker imageLogs
No response
The text was updated successfully, but these errors were encountered: