diff options
Diffstat (limited to 'extensions/net')
-rw-r--r-- | extensions/net/Cargo.toml | 4 | ||||
-rw-r--r-- | extensions/net/ops_tls.rs | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/extensions/net/Cargo.toml b/extensions/net/Cargo.toml index 58363fd2e..09daf0e48 100644 --- a/extensions/net/Cargo.toml +++ b/extensions/net/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_net" -version = "0.4.0" +version = "0.5.0" authors = ["the Deno authors"] edition = "2018" license = "MIT" @@ -14,7 +14,7 @@ description = "Networking for Deno" path = "lib.rs" [dependencies] -deno_core = { version = "0.95.0", path = "../../core" } +deno_core = { version = "0.96.0", path = "../../core" } deno_tls = { version = "0.1.0", path = "../tls" } lazy_static = "1.4.0" diff --git a/extensions/net/ops_tls.rs b/extensions/net/ops_tls.rs index 91fad6706..14a135d7d 100644 --- a/extensions/net/ops_tls.rs +++ b/extensions/net/ops_tls.rs @@ -700,6 +700,12 @@ where let hostname_dns = DNSNameRef::try_from_ascii_str(hostname) .map_err(|_| invalid_hostname(hostname))?; + let unsafely_ignore_certificate_errors = state + .borrow() + .borrow::<UnsafelyIgnoreCertificateErrors>() + .0 + .clone(); + // TODO(@justinmchase): Ideally the certificate store is created once // and not cloned. The store should be wrapped in Arc<T> to reduce // copying memory unnecessarily. @@ -721,8 +727,11 @@ where let local_addr = tcp_stream.local_addr()?; let remote_addr = tcp_stream.peer_addr()?; - let tls_config = - Arc::new(create_client_config(root_cert_store, ca_data, None)?); + let tls_config = Arc::new(create_client_config( + root_cert_store, + ca_data, + unsafely_ignore_certificate_errors, + )?); let tls_stream = TlsStream::new_client_side(tcp_stream, &tls_config, hostname_dns); |