Closed lcmgh closed 1 year ago
I am also curious how it is determined which tls lib the hyper client should use?
That's up to how a client crate of aws-smithy-client
enables the cargo features native-tls
and rustls
. When depending on an SDK crate, which is usually the case, the client gets rustls
, as shown in the default feature in aws-config
(if the client directly depends on aws-smithy-client
without enabling native-tls
or rustls
, no tls library has been selected for hyper client).
To better assist, could you paste your complete Cargo.toml
so that we can reproduce what you are observing on our end?
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.
Hi @ysaito1001 . Here is my Cargo.toml
[package]
name = "myapp"
version = "1.1.2"
edition = "2021"
default-run = "myapp"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
# AWS SDK
aws-config = { version = "0.53.0", default-features = false, features = ["rustls"] }
aws-smithy-client = { version = "0.54.0", features = ["client-hyper", "rustls"] }
aws-sdk-kinesis = { version = "0.23.0", default-features = false, features = ["rustls"] }
aws-sdk-dynamodb = { version = "0.23.0", default-features = false, features = ["rustls"] }
aws-types = { version = "0.53.0", default-features = false }
tokio-retry = "0.3"
# App settings (read from env, file etc.)
config = { version = "0.13.1", features = ["toml"], default-features = false }
# Serialization
serde = { version = "1.0.138", features = ["derive"] }
serde_json = "1.0.82"
# Kinesis client lib
kinesis-client = { git = "ssh://git@xxx/kinesis-client-rs.git", rev = "v0.1.3", features = ["rustls"] }
# Parallel iterators for utilizing all cpu cores
rayon = "1.5.3"
# Spawn CPU heavy task in rayon tokio threads
tokio-rayon = "2.1.0"
# Async runtime
tokio = { version = "1.19.2", features = ["full"] }
# Logging
tracing = "0.1.35"
tracing-subscriber = { version = "0.3.14", features = ["tracing-log", "json"] }
# Metrics
metrics-exporter-prometheus = { version = "0.11.0", default-features = false, features = ["http-listener"] }
metrics = "0.20.1"
# SQL driver
sqlx = { version = "0.6.0", features = [ "runtime-tokio-rustls", "postgres" ] }
# Derive error types
thiserror = "1.0.31"
# Generic error type for results
eyre = "0.6.8"
testcontainers = { version = "0.14.0", optional = true }
hyper = "0.14.19"
compact_str = { version = "0.6.1", features = ["serde", "bytes"] }
# Gzip
flate2 = "1.0.24"
# To create random mileages in test set / stub
fastrand = { version = "1.7.0", optional = true }
[features]
default = ["local"]
# Stub dependencies
local = ["testcontainers", "fastrand"]
[dev-dependencies]
# Spawns docker containers
testcontainers = "0.14.0"
# Provides callback if variables goes out of scope
scopeguard = "1.1.0"
# http client
reqwest = { version = "0.11.11", features = ["json", "rustls"], default-features = false }
# For some reason mileages are stored as psql NUMERIC in database
rust_decimal = "1.25.0"
# Psql client
sqlx = { version = "0.6.0", features = [ "runtime-tokio-rustls", "postgres", "decimal" ] }
# Time lib for db date fields
# Benchmark lib
criterion = "0.4.0"
tokio-retry = "0.3"
[[bin]]
name = "myapp"
[[bin]]
name = "stub"
path = "src/stub.rs"
required-features = ["local"]
[[bench]]
name = "my_benchmark"
harness = false
Thank you for providing us with a complete Cargo.toml
. When I copied & pasted the contents of that file and ran cargo tree > tree.txt
, I still failed to reproduce the issue of both hyper-tls v0.5.0
and hyper-rustls v0.23.2
appearing in tree.txt
, i.e., I only saw hyper-rustls
in the output:
├── aws-config v0.53.0
...
│ ├── aws-http v0.53.0
...
│ │ ├── aws-types v0.53.0
...
│ │ │ ├── aws-smithy-client v0.53.1
...
│ │ │ │ ├── hyper-rustls v0.23.2
...
I have two questions:
Cargo.toml
, aws-smithy-client
has version = "0.54.0"
whereas aws-config
and aws-types
are version = 0.53.0
. Is there a reason why you chose a different version for aws-smithy-client
?Cargo.lock
and run cargo tree
, do you still see both hyper-tls
and hyper-rustls
in the output?Issue was on my side, sorry. Had added internal dependencies without default-features = false
which by default used native-tls.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
Hi!
I am in the process of switching from openssl to rustls so I scanned my project for
native-tls
. It looks like aws-config shipsrustls
andnative-tls
if I am not mistaken. I would like to includerustls
only when the appropriate feature flags are set to ensure my app will work on images without OpenSSL.I am also curious how it is determined which tls lib the hyper client should use?
Cargo.toml
cargo tree --features rustls --no-default-features >> tree.txt
Expected Behavior
Additional feature flag to use hyper rustls or hyper native-tls.
Current Behavior
hyper-client includes dependencies for rustls and native-tls.
Reproduction Steps
See above.
Possible Solution
Add new feature flags
Additional Information/Context
No response
Version
Environment details (OS name and version, etc.)
macOS Montery
Logs
No response