mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 08:04:52 +01:00
cert path fix
This commit is contained in:
@@ -75,8 +75,8 @@ impl HttpHandler for ProxyHandler {
|
|||||||
*/
|
*/
|
||||||
pub async fn create_proxy(proxy_port: u16, certificate_path: String) {
|
pub async fn create_proxy(proxy_port: u16, certificate_path: String) {
|
||||||
// Get the certificate and private key.
|
// 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 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 ca_cert_bytes: &[u8] = &fs::read(format!("{}\\cert.crt", certificate_path)).expect("Could not read certificate");
|
||||||
|
|
||||||
// Parse the private key and certificate.
|
// Parse the private key and certificate.
|
||||||
let private_key = rustls::PrivateKey(
|
let private_key = rustls::PrivateKey(
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {invoke} from '@tauri-apps/api/tauri'
|
|||||||
import {dataDir} from '@tauri-apps/api/path'
|
import {dataDir} from '@tauri-apps/api/path'
|
||||||
|
|
||||||
async function startProxy() {
|
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() {
|
async function stopProxy() {
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Connect to proxy
|
// 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
|
// Launch the program
|
||||||
|
|||||||
Reference in New Issue
Block a user