From 418f8a0fa81f08f8435fab7b2b7d42222629b883 Mon Sep 17 00:00:00 2001 From: QuantumEntangledAndy Date: Fri, 3 Jul 2020 11:49:23 +0700 Subject: [PATCH] Use new from file when loading the pem --- src/gst.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gst.rs b/src/gst.rs index 02bd375..d8cd28f 100644 --- a/src/gst.rs +++ b/src/gst.rs @@ -126,7 +126,7 @@ impl RtspServer { debug!("Setting up TLS using {}", cert_file); let auth = self.server.get_auth().unwrap_or_else(RTSPAuth::new()); - let cert = TlsCertificate::new_from_pem(&fs::read_to_string(cert_file).expect("TLS file not found")).expect("Not a valid TLS certificate"); + let cert = TlsCertificate::new_from_file(cert_file).expect("Not a valid TLS certificate or not found."); auth.set_tls_certificate(Some(&cert)); auth.set_tls_authentication_mode(client_auth); auth.set_supported_methods(RTSPAuthMethod::None);