Skip to content

Commit 30c6f47

Browse files
committed
Expose and forward rustls default features
tls12 and logging are rustls features we enable by default, as does rustls, exposing them explicitly allows users to disable them by disabling hyper-rustls default features.
1 parent bc8023b commit 30c6f47

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ homepage = "https://github.com/ctz/hyper-rustls"
1010
repository = "https://github.com/ctz/hyper-rustls"
1111

1212
[dependencies]
13-
log = "0.4.4"
13+
log = { version = "0.4.4", optional = true }
1414
http = "0.2"
1515
hyper = { version = "0.14", default-features = false, features = ["client"] }
16-
rustls = "0.20"
16+
rustls = { version = "0.20", default-features = false }
1717
rustls-native-certs = { version = "0.6", optional = true }
1818
tokio = "1.0"
19-
tokio-rustls = "0.23"
19+
tokio-rustls = { version = "0.23", default-features = false }
2020
webpki-roots = { version = "0.22", optional = true }
2121

2222
[dev-dependencies]
@@ -27,12 +27,14 @@ futures-util = { version = "0.3.1", default-features = false }
2727
rustls-pemfile = "0.2.1"
2828

2929
[features]
30-
default = ["native-tokio", "http1"]
30+
default = ["native-tokio", "http1", "tls12", "logging"]
3131
http1 = ["hyper/http1"]
3232
http2 = ["hyper/http2"]
3333
webpki-tokio = ["tokio-runtime", "webpki-roots"]
3434
native-tokio = ["tokio-runtime", "rustls-native-certs"]
3535
tokio-runtime = ["hyper/runtime"]
36+
tls12 = ["tokio-rustls/tls12", "rustls/tls12"]
37+
logging = ["log", "tokio-rustls/logging", "rustls/logging"]
3638

3739
[[example]]
3840
name = "client"

src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ impl ConfigBuilderExt for ConfigBuilder<ClientConfig, WantsVerifier> {
2929
for cert in rustls_native_certs::load_native_certs().expect("could not load platform certs")
3030
{
3131
let cert = rustls::Certificate(cert.0);
32+
#[cfg_attr(not(feature = "logging"), allow(unused_variables))]
3233
match roots.add(&cert) {
3334
Ok(_) => valid_count += 1,
3435
Err(err) => {

0 commit comments

Comments
 (0)