From 6b42cecc064d01d87aae978ecd7eb372bfe9a34e Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Wed, 15 Nov 2023 16:12:46 -0700 Subject: feat(ext/net): use rustls_tokio_stream (#21205) Fixes #21121 and #19498 Migrates fully to rustls_tokio_stream. We no longer need to maintain our own TlsStream implementation to properly support duplex. This should fix a number of errors with TLS and websockets, HTTP and "other" places where it's failing. --- ext/http/http_next.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/http') diff --git a/ext/http/http_next.rs b/ext/http/http_next.rs index f42275b0e..98fbd1f8b 100644 --- a/ext/http/http_next.rs +++ b/ext/http/http_next.rs @@ -850,15 +850,15 @@ fn serve_https( }); spawn( async { - io.handshake().await?; + let handshake = io.handshake().await?; // If the client specifically negotiates a protocol, we will use it. If not, we'll auto-detect // based on the prefix bytes - let handshake = io.get_ref().1.alpn_protocol(); - if handshake == Some(TLS_ALPN_HTTP_2) { + let handshake = handshake.alpn; + if Some(TLS_ALPN_HTTP_2) == handshake.as_deref() { serve_http2_unconditional(io, svc, listen_cancel_handle) .await .map_err(|e| e.into()) - } else if handshake == Some(TLS_ALPN_HTTP_11) { + } else if Some(TLS_ALPN_HTTP_11) == handshake.as_deref() { serve_http11_unconditional(io, svc, listen_cancel_handle) .await .map_err(|e| e.into()) -- cgit v1.2.3