Skip to content

Commit

Permalink
mark Deno.startTls as unstable (#4965)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju authored Apr 28, 2020
1 parent 76ee6fb commit f7ab19b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cli/ops/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ struct StartTLSArgs {

pub fn op_start_tls(
isolate: &mut CoreIsolate,
_state: &State,
state: &State,
args: Value,
_zero_copy: Option<ZeroCopyBuf>,
) -> Result<JsonOp, OpError> {
state.check_unstable("Deno.startTls");
let args: StartTLSArgs = serde_json::from_value(args)?;
let rid = args.rid as u32;
let cert_file = args.cert_file.clone();
Expand All @@ -68,6 +69,11 @@ pub fn op_start_tls(
domain.push_str("localhost");
}

state.check_net(&domain, 0)?;
if let Some(path) = cert_file.clone() {
state.check_read(Path::new(&path))?;
}

let op = async move {
let mut resource_holder = {
let mut resource_table_ = resource_table.borrow_mut();
Expand Down

0 comments on commit f7ab19b

Please sign in to comment.