summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/net/ops_tls.rs7
-rw-r--r--ext/websocket/lib.rs11
2 files changed, 10 insertions, 8 deletions
diff --git a/ext/net/ops_tls.rs b/ext/net/ops_tls.rs
index d16bface4..255c6ddbd 100644
--- a/ext/net/ops_tls.rs
+++ b/ext/net/ops_tls.rs
@@ -27,6 +27,7 @@ use deno_tls::create_client_config;
use deno_tls::load_certs;
use deno_tls::load_private_keys;
use deno_tls::rustls::Certificate;
+use deno_tls::rustls::ClientConnection;
use deno_tls::rustls::PrivateKey;
use deno_tls::rustls::ServerConfig;
use deno_tls::rustls::ServerName;
@@ -230,8 +231,7 @@ where
let tls_config = Arc::new(tls_config);
let tls_stream = TlsStream::new_client_side(
tcp_stream,
- tls_config,
- hostname_dns,
+ ClientConnection::new(tls_config, hostname_dns).unwrap(),
TLS_BUFFER_SIZE,
);
@@ -327,8 +327,7 @@ where
let tls_stream = TlsStream::new_client_side(
tcp_stream,
- tls_config,
- hostname_dns,
+ ClientConnection::new(tls_config, hostname_dns).unwrap(),
TLS_BUFFER_SIZE,
);
diff --git a/ext/websocket/lib.rs b/ext/websocket/lib.rs
index 4b544b4f8..60b0911b1 100644
--- a/ext/websocket/lib.rs
+++ b/ext/websocket/lib.rs
@@ -23,6 +23,7 @@ use deno_core::ToJsBuffer;
use deno_net::raw::NetworkStream;
use deno_tls::create_client_config;
use deno_tls::rustls::ClientConfig;
+use deno_tls::rustls::ClientConnection;
use deno_tls::RootCertStoreProvider;
use deno_tls::SocketUse;
use http::header::CONNECTION;
@@ -236,8 +237,7 @@ async fn handshake_http1_wss(
ServerName::try_from(domain).map_err(|_| invalid_hostname(domain))?;
let mut tls_connector = TlsStream::new_client_side(
tcp_socket,
- tls_config.into(),
- dnsname,
+ ClientConnection::new(tls_config.into(), dnsname).unwrap(),
NonZeroUsize::new(65536),
);
// If we can bail on an http/1.1 ALPN mismatch here, we can avoid doing extra work
@@ -261,8 +261,11 @@ async fn handshake_http2_wss(
let dnsname =
ServerName::try_from(domain).map_err(|_| invalid_hostname(domain))?;
// We need to better expose the underlying errors here
- let mut tls_connector =
- TlsStream::new_client_side(tcp_socket, tls_config.into(), dnsname, None);
+ let mut tls_connector = TlsStream::new_client_side(
+ tcp_socket,
+ ClientConnection::new(tls_config.into(), dnsname).unwrap(),
+ None,
+ );
let handshake = tls_connector.handshake().await?;
if handshake.alpn.is_none() {
bail!("Didn't receive h2 alpn, aborting connection");