Skip to content

Commit

Permalink
chore: accept ref OsStr
Browse files Browse the repository at this point in the history
  • Loading branch information
tejmagar committed Jun 11, 2024
1 parent ddfa1d8 commit 3f8d31b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/core/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub mod utils;
use std::any::Any;
use std::collections::HashMap;
use std::env;
use std::ffi::OsStr;
use std::path::PathBuf;
use std::pin::Pin;
use std::sync::atomic::{AtomicBool, Ordering};
Expand Down Expand Up @@ -150,10 +151,10 @@ impl Server {
instance
}

pub fn bind_tls<S: AsRef<str>>(
pub fn bind_tls<S: AsRef<str>, P: AsRef<OsStr>>(
address: S,
certificate_path: S,
private_key_path: S,
certificate_path: P,
private_key_path: P,
) -> std::io::Result<Self> {
let acceptor = utils::tls_acceptor_from_path(certificate_path, private_key_path)?;
let mut instance = Server::initialize_default();
Expand Down
4 changes: 2 additions & 2 deletions src/core/server/utils.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use std::io::BufReader;
use std::{ffi::OsStr, io::BufReader};
use std::sync::Arc;

use rustls_pemfile::{certs, pkcs8_private_keys};
use tokio_rustls::TlsAcceptor;

use crate::racoon_info;

pub fn tls_acceptor_from_path<S: AsRef<str>>(
pub fn tls_acceptor_from_path<S: AsRef<OsStr>>(
certificate_path: S,
private_key_path: S,
) -> std::io::Result<TlsAcceptor> {
Expand Down

0 comments on commit 3f8d31b

Please sign in to comment.