diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-11-15 16:12:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-15 16:12:46 -0700 |
commit | 6b42cecc064d01d87aae978ecd7eb372bfe9a34e (patch) | |
tree | 3fb7f0e4be0c1e8184dde61f96324c7a8419d6b9 /ext/http/http_next.rs | |
parent | 40726721e287b2d6c44839d9081dccb408886cab (diff) |
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.
Diffstat (limited to 'ext/http/http_next.rs')
-rw-r--r-- | ext/http/http_next.rs | 8 |
1 files changed, 4 insertions, 4 deletions
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()) |