summaryrefslogtreecommitdiff
path: root/ext/net/ops_tls.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-11-01 15:11:01 -0600
committerGitHub <noreply@github.com>2023-11-01 21:11:01 +0000
commit42c426e7695a0037032d1ac5237830800eeaaed4 (patch)
tree242f9aa30187464f1b6314387654a76d8dc76fc0 /ext/net/ops_tls.rs
parent587f2e0800a55e58b2579758d4278a4129b609c0 (diff)
feat(ext/websocket): websockets over http2 (#21040)
Implements `WebSocket` over http/2. This requires a conformant http/2 server supporting the extended connect protocol. Passes approximately 100 new WPT tests (mostly `?wpt_flags=h2` versions of existing websockets APIs). This is implemented as a fallback when http/1.1 fails, so a server that supports both h1 and h2 WebSockets will still end up on the http/1.1 upgrade path. The patch also cleas up the websockets handshake to split it up into http, https+http1 and https+http2, making it a little less intertwined. This uncovered a likely bug in the WPT test server: https://github.com/web-platform-tests/wpt/issues/42896
Diffstat (limited to 'ext/net/ops_tls.rs')
-rw-r--r--ext/net/ops_tls.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/net/ops_tls.rs b/ext/net/ops_tls.rs
index fe0e70a5c..26ec48fba 100644
--- a/ext/net/ops_tls.rs
+++ b/ext/net/ops_tls.rs
@@ -47,6 +47,7 @@ use deno_tls::rustls::PrivateKey;
use deno_tls::rustls::ServerConfig;
use deno_tls::rustls::ServerConnection;
use deno_tls::rustls::ServerName;
+use deno_tls::SocketUse;
use io::Error;
use io::Read;
use io::Write;
@@ -839,6 +840,7 @@ where
ca_certs,
unsafely_ignore_certificate_errors,
None,
+ SocketUse::GeneralSsl,
)?;
if let Some(alpn_protocols) = args.alpn_protocols {
@@ -938,6 +940,7 @@ where
ca_certs,
unsafely_ignore_certificate_errors,
cert_chain_and_key,
+ SocketUse::GeneralSsl,
)?;
if let Some(alpn_protocols) = args.alpn_protocols {