summaryrefslogtreecommitdiff
path: root/cli/ops/tls.rs
diff options
context:
space:
mode:
authorNayeem Rahman <muhammed.9939@gmail.com>2020-01-20 14:45:44 +0000
committerRy Dahl <ry@tinyclouds.org>2020-01-20 09:45:44 -0500
commit7f80f9db3f4c3b064b230adfec7ff958fc195da6 (patch)
treebda74057420a1b51ce293918b6e67123715ee945 /cli/ops/tls.rs
parent60b53fd6b6dc2af83a64c332b9f3a1926f43d631 (diff)
refactor: Improve path handling in permission checks (#3714)
Diffstat (limited to 'cli/ops/tls.rs')
-rw-r--r--cli/ops/tls.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/cli/ops/tls.rs b/cli/ops/tls.rs
index cb0ae2ecb..87a067a9e 100644
--- a/cli/ops/tls.rs
+++ b/cli/ops/tls.rs
@@ -16,6 +16,7 @@ use std::fs::File;
use std::future::Future;
use std::io::BufReader;
use std::net::SocketAddr;
+use std::path::Path;
use std::pin::Pin;
use std::sync::Arc;
use std::task::Context;
@@ -69,7 +70,7 @@ pub fn op_connect_tls(
let state_ = state.clone();
state.check_net(&args.hostname, args.port)?;
if let Some(path) = cert_file.clone() {
- state.check_read(&path)?;
+ state.check_read(Path::new(&path))?;
}
let mut domain = args.hostname.clone();
@@ -254,8 +255,8 @@ fn op_listen_tls(
let key_file = args.key_file;
state.check_net(&args.hostname, args.port)?;
- state.check_read(&cert_file)?;
- state.check_read(&key_file)?;
+ state.check_read(Path::new(&cert_file))?;
+ state.check_read(Path::new(&key_file))?;
let mut config = ServerConfig::new(NoClientAuth::new());
config