mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-13 07:34:36 +01:00
dynamically read cert and priv key
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user