File: rustls-native-certs-0.8.patch

package info (click to toggle)
rust-hickory-resolver 0.24.4-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 860 kB
  • sloc: makefile: 2
file content (40 lines) | stat: -rw-r--r-- 1,477 bytes parent folder | download
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
Index: hickory-resolver/Cargo.toml
===================================================================
--- hickory-resolver.orig/Cargo.toml
+++ hickory-resolver/Cargo.toml
@@ -123,7 +123,7 @@ features = ["logging", "std", "tls12"]
 optional = true
 
 [dependencies.rustls-native-certs]
-version = "0.7"
+version = "0.8"
 optional = true
 
 [dependencies.serde]
Index: hickory-resolver/src/tls/dns_over_rustls.rs
===================================================================
--- hickory-resolver.orig/src/tls/dns_over_rustls.rs
+++ hickory-resolver/src/tls/dns_over_rustls.rs
@@ -35,9 +35,20 @@ pub(crate) static CLIENT_CONFIG: Lazy<Re
     #[cfg(all(feature = "native-certs", not(feature = "webpki-roots")))]
     {
         use proto::error::ProtoErrorKind;
-
+        let certs = rustls_native_certs::load_native_certs();
+        if certs.errors.len() > 0 {
+            if certs.certs.len() == 0 {
+                return Err(format!("{:?}",certs.errors).into());
+            } else {
+                tracing::warn!(
+                    "load_native_certs returned {} certs and {} errors",
+                    certs.certs.len(),
+                    certs.errors.len(),
+                );
+            }
+        }
         let (added, ignored) =
-            root_store.add_parsable_certificates(rustls_native_certs::load_native_certs()?);
+            root_store.add_parsable_certificates(certs.certs);
 
         if ignored > 0 {
             tracing::warn!(