mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-07 11:59:59 +03:00
create config directory if it does not exist
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use std::fs;
|
||||
use std::io::{self, BufWriter, Read, Write};
|
||||
use std::path::Path;
|
||||
use std::{fs::File, io::BufReader};
|
||||
@@ -54,6 +55,8 @@ pub(crate) fn load_or_generate_key_and_cert(path: &Path) -> Result<Certificate,
|
||||
pub(crate) fn generate_key_and_cert(path: &Path) -> Result<Certificate, Error> {
|
||||
let cert = Certificate::generate_self_signed(["ignored".to_owned()])?;
|
||||
let serialized = cert.serialize_pem();
|
||||
let parent = path.parent().expect("is a path");
|
||||
fs::create_dir_all(parent)?;
|
||||
let f = File::create(path)?;
|
||||
#[cfg(unix)]
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user