Description: use older branch of crate rustls-native-certs (1/2)
 This essentially reverts upstream git commit 2289b50.
Author: tottoto <tottotodev@gmail.com>
Forwarded: not-needed
Last-Update: 2025-03-16
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/tonic/Cargo.toml
+++ b/tonic/Cargo.toml
@@ -89,7 +89,7 @@
 
 # rustls
 rustls-pemfile = { version = "2.0", optional = true }
-rustls-native-certs = { version = "0.8", optional = true }
+rustls-native-certs = { version = "0.7", optional = true }
 tokio-rustls = { version = "0.26", default-features = false, features = ["logging", "tls12", "ring"], optional = true }
 webpki-roots = { version = "0.26", optional = true }
 
--- a/tonic/src/transport/channel/service/tls.rs
+++ b/tonic/src/transport/channel/service/tls.rs
@@ -38,15 +38,7 @@
 
         #[cfg(feature = "tls-native-roots")]
         if with_native_roots {
-            let rustls_native_certs::CertificateResult { certs, errors, .. } =
-                rustls_native_certs::load_native_certs();
-            if !errors.is_empty() {
-                tracing::debug!("errors occured when loading native certs: {errors:?}");
-            }
-            if certs.is_empty() {
-                return Err(TlsError::NativeCertsNotFound.into());
-            }
-            roots.add_parsable_certificates(certs);
+            roots.add_parsable_certificates(rustls_native_certs::load_native_certs()?);
         }
 
         #[cfg(feature = "tls-webpki-roots")]
