summaryrefslogtreecommitdiff
path: root/runtime/ops/tls.rs
diff options
context:
space:
mode:
authorcrowlKats <13135287+crowlKats@users.noreply.github.com>2021-03-17 22:45:12 +0100
committerGitHub <noreply@github.com>2021-03-17 17:45:12 -0400
commit0e70d9e59bc0e70f1921bb217ee00fc2e6facb69 (patch)
treed501399bd07855148ce817c568e7228bdfd87d87 /runtime/ops/tls.rs
parentb3fe85163f303a1592335b23c25554dd0e39a4c4 (diff)
refactor: clean up permission handling (#9367)
Diffstat (limited to 'runtime/ops/tls.rs')
-rw-r--r--runtime/ops/tls.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/runtime/ops/tls.rs b/runtime/ops/tls.rs
index 893c068c4..f35425555 100644
--- a/runtime/ops/tls.rs
+++ b/runtime/ops/tls.rs
@@ -110,9 +110,9 @@ async fn op_start_tls(
super::check_unstable2(&state, "Deno.startTls");
let s = state.borrow();
let permissions = s.borrow::<Permissions>();
- permissions.check_net(&(&domain, Some(0)))?;
+ permissions.net.check(&(&domain, Some(0)))?;
if let Some(path) = &args.cert_file {
- permissions.check_read(Path::new(&path))?;
+ permissions.read.check(Path::new(&path))?;
}
}
@@ -174,9 +174,9 @@ async fn op_connect_tls(
{
let s = state.borrow();
let permissions = s.borrow::<Permissions>();
- permissions.check_net(&(&args.hostname, Some(args.port)))?;
+ permissions.net.check(&(&args.hostname, Some(args.port)))?;
if let Some(path) = &args.cert_file {
- permissions.check_read(Path::new(&path))?;
+ permissions.read.check(Path::new(&path))?;
}
}
let mut domain = args.hostname.as_str();
@@ -318,9 +318,9 @@ fn op_listen_tls(
let key_file = args.key_file;
{
let permissions = state.borrow::<Permissions>();
- permissions.check_net(&(&args.hostname, Some(args.port)))?;
- permissions.check_read(Path::new(&cert_file))?;
- permissions.check_read(Path::new(&key_file))?;
+ permissions.net.check(&(&args.hostname, Some(args.port)))?;
+ permissions.read.check(Path::new(&cert_file))?;
+ permissions.read.check(Path::new(&key_file))?;
}
let mut config = ServerConfig::new(NoClientAuth::new());
config