1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
This patch is based on a revert of upstream commit d85f44b217f36f8bef065fe95877eab98c52c2e5
adapted for use in the Debian package by Peter Michael Green.
Index: reqwest/src/async_impl/client.rs
===================================================================
--- reqwest.orig/src/async_impl/client.rs
+++ reqwest/src/async_impl/client.rs
@@ -532,9 +532,9 @@ impl ClientBuilder {
if config.tls_built_in_certs_native {
let mut valid_count = 0;
let mut invalid_count = 0;
-
- let load_results = rustls_native_certs::load_native_certs();
- for cert in load_results.certs {
+ for cert in rustls_native_certs::load_native_certs()
+ .map_err(crate::error::builder)?
+ {
// Continue on parsing errors, as native stores often include ancient or syntactically
// invalid certificates, like root certificates without any X509 extensions.
// Inspiration: https://github.com/rustls/rustls/blob/633bf4ba9d9521a95f68766d04c22e2b01e68318/rustls/src/anchors.rs#L105-L112
@@ -547,21 +547,9 @@ impl ClientBuilder {
}
}
if valid_count == 0 && invalid_count > 0 {
- let err = if load_results.errors.is_empty() {
- crate::error::builder(
- "zero valid certificates found in native root store",
- )
- } else {
- use std::fmt::Write as _;
- let mut acc = String::new();
- for err in load_results.errors {
- let _ = writeln!(&mut acc, "{err}");
- }
-
- crate::error::builder(acc)
- };
-
- return Err(err);
+ return Err(crate::error::builder(
+ "zero valid certificates found in native root store",
+ ));
}
}
Index: reqwest/Cargo.toml
===================================================================
--- reqwest.orig/Cargo.toml
+++ reqwest/Cargo.toml
@@ -471,7 +471,7 @@ optional = true
default-features = false
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.rustls-native-certs]
-version = "0.8.0"
+version = "0.7.0"
optional = true
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.rustls-pemfile]
|