File: rustls-native-certs.patch

package info (click to toggle)
rust-irc 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 428 kB
  • sloc: makefile: 2
file content (32 lines) | stat: -rw-r--r-- 905 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
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -134,4 +134,4 @@
 
-[dependencies.webpki-roots]
-version = "0.23.0"
+[dependencies.rustls-native-certs]
+version = "0.6"
 optional = true
@@ -186,3 +186,3 @@
     "tokio-rustls",
-    "webpki-roots",
+    "rustls-native-certs",
     "rustls-pemfile",
--- a/src/client/conn.rs
+++ b/src/client/conn.rs
@@ -302,11 +302,6 @@
 
-            root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(
-                |ta| {
-                    OwnedTrustAnchor::from_subject_spki_name_constraints(
-                        ta.subject,
-                        ta.spki,
-                        ta.name_constraints,
-                    )
-                },
-            ));
+            let certs = rustls_native_certs::load_native_certs()?;
+            for cert in certs {
+                root_store.add(&Certificate(cert.0))?;
+            }