From 6f5ed86f031a141b44d362f1948658cab6e6ce2b Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Sun, 29 May 2022 21:14:31 -0700 Subject: [PATCH] cert path fix --- src-tauri/src/proxy.rs | 4 ++-- src/ui/Test.tsx | 2 +- src/ui/components/ServerLaunchSection.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src-tauri/src/proxy.rs b/src-tauri/src/proxy.rs index e53ebb1..a79a4f4 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] = &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"); + 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( diff --git a/src/ui/Test.tsx b/src/ui/Test.tsx index 90894ac..ae7d39d 100644 --- a/src/ui/Test.tsx +++ b/src/ui/Test.tsx @@ -4,7 +4,7 @@ import {invoke} from '@tauri-apps/api/tauri' import {dataDir} from '@tauri-apps/api/path' async function startProxy() { - await invoke('connect', { port: 2222, certificatePath: await dataDir() + '\\ca' }) + await invoke('connect', { port: 2222, certificatePath: await dataDir() + '\\cultivation\\ca' }) } async function stopProxy() { diff --git a/src/ui/components/ServerLaunchSection.tsx b/src/ui/components/ServerLaunchSection.tsx index ddfcb58..609b309 100644 --- a/src/ui/components/ServerLaunchSection.tsx +++ b/src/ui/components/ServerLaunchSection.tsx @@ -106,7 +106,7 @@ export default class ServerLaunchSection extends React.Component }) // Connect to proxy - await invoke('connect', { port: 8365, certificatePath: await dataDir() + '\\ca' }) + await invoke('connect', { port: 8365, certificatePath: await dataDir() + '\\cultivation\\ca' }) } // Launch the program