From 2488bc346c076ff0961caeab40a6326503b843e7 Mon Sep 17 00:00:00 2001 From: Lucas Sas Brunschier Date: Mon, 27 Mar 2023 16:26:21 +0200 Subject: [PATCH 1/2] feat: 'use-rustls' and 'native-tls' features This commit introduces two new features: - (default) `native-tls` which enables the reqwest `default-tls` feature -> this configuration is the same as the previous default. Therefore no change in default behvior is introduced. - `use-rustls` replaces the `default-tls` feature with the `rustls-tls-manual-roots` reqwest feature. This removes the openssl dependency and uses the rustls ssl implemention. This change is useful, because for some use cases it may not be optimal to depend on the openssl system lib. For example cross-compilation. --- hawkbit/Cargo.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hawkbit/Cargo.toml b/hawkbit/Cargo.toml index 6dcc370..e681212 100644 --- a/hawkbit/Cargo.toml +++ b/hawkbit/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://github.com/collabora/hawkbit-rs" documentation = "https://docs.rs/hawkbit_mock/" [dependencies] -reqwest = { version = "0.11", features = ["json", "stream"] } +reqwest = { version = "0.11", default-features=false, features = ["json", "stream"] } tokio = { version = "1.1", features = ["time", "fs"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" @@ -37,6 +37,11 @@ tempdir = "0.3" assert_matches = "1.4" [features] +default = ["native-tls"] + +native-tls = ["reqwest/default-tls"] +use-rustls = ["reqwest/rustls-tls-manual-roots"] + hash-digest= ["digest", "generic-array"] hash-md5 = ["md-5", "hash-digest"] hash-sha1 = ["sha-1", "hash-digest"] From e4c48da4a18a46ab4b3dcde0fca6ad2b1e5799ab Mon Sep 17 00:00:00 2001 From: Lucas Sas Brunschier Date: Thu, 20 Apr 2023 16:38:14 +0200 Subject: [PATCH 2/2] feat: use 'rustls-tls' reqwest feature this instructs reqwest to use system cas for cert validation --- hawkbit/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hawkbit/Cargo.toml b/hawkbit/Cargo.toml index e681212..531b3ee 100644 --- a/hawkbit/Cargo.toml +++ b/hawkbit/Cargo.toml @@ -40,7 +40,7 @@ assert_matches = "1.4" default = ["native-tls"] native-tls = ["reqwest/default-tls"] -use-rustls = ["reqwest/rustls-tls-manual-roots"] +use-rustls = ["reqwest/rustls-tls"] hash-digest= ["digest", "generic-array"] hash-md5 = ["md-5", "hash-digest"]