From e99bea7a15537f309fa3e18dc89ad000a1f6d5fa Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Sun, 29 May 2022 19:44:54 -0700 Subject: [PATCH] dynamically read cert and priv key --- src-tauri/src/proxy.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/proxy.rs b/src-tauri/src/proxy.rs index 4c776a0..e53ebb1 100644 --- a/src-tauri/src/proxy.rs +++ b/src-tauri/src/proxy.rs @@ -75,8 +75,8 @@ impl HttpHandler for ProxyHandler { */ pub async fn create_proxy(proxy_port: u16, certificate_path: String) { // Get the certificate and private key. - let mut private_key_bytes: &[u8] = include_bytes!(format!("{}/private.key", certificate_path)); - let mut ca_cert_bytes: &[u8] = include_bytes!(format!("{}/cert.crt", certificate_path)); + let mut private_key_bytes: &[u8] = &fs::read(format!("{}/private.key", certificate_path)).expect("Could not read private key"); + let mut ca_cert_bytes: &[u8] = &fs::read(format!("{}/cert.crt", certificate_path)).expect("Could not read certificate"); // Parse the private key and certificate. let private_key = rustls::PrivateKey(