diff --git a/Cargo.toml b/Cargo.toml index fa4a672..fa8cae7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,13 +10,13 @@ homepage = "https://github.com/ctz/hyper-rustls" repository = "https://github.com/ctz/hyper-rustls" [dependencies] -log = "0.4.4" +log = { version = "0.4.4", optional = true } http = "0.2" hyper = { version = "0.14", default-features = false, features = ["client"] } -rustls = "0.20" +rustls = { version = "0.20", default-features = false } rustls-native-certs = { version = "0.6", optional = true } tokio = "1.0" -tokio-rustls = "0.23" +tokio-rustls = { version = "0.23", default-features = false } webpki-roots = { version = "0.22", optional = true } [dev-dependencies] @@ -27,12 +27,14 @@ futures-util = { version = "0.3.1", default-features = false } rustls-pemfile = "0.2.1" [features] -default = ["native-tokio", "http1"] +default = ["native-tokio", "http1", "tls12", "logging"] http1 = ["hyper/http1"] http2 = ["hyper/http2"] webpki-tokio = ["tokio-runtime", "webpki-roots"] native-tokio = ["tokio-runtime", "rustls-native-certs"] tokio-runtime = ["hyper/runtime"] +tls12 = ["tokio-rustls/tls12", "rustls/tls12"] +logging = ["log", "tokio-rustls/logging", "rustls/logging"] [[example]] name = "client" diff --git a/src/config.rs b/src/config.rs index 38acf7b..1f955e4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -29,6 +29,7 @@ impl ConfigBuilderExt for ConfigBuilder { for cert in rustls_native_certs::load_native_certs().expect("could not load platform certs") { let cert = rustls::Certificate(cert.0); + #[cfg_attr(not(feature = "logging"), allow(unused_variables))] match roots.add(&cert) { Ok(_) => valid_count += 1, Err(err) => {