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. --- cli/tests/integration/cert_tests.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'cli/tests/integration') diff --git a/cli/tests/integration/cert_tests.rs b/cli/tests/integration/cert_tests.rs index 20bf4d80d..f53ce9cee 100644 --- a/cli/tests/integration/cert_tests.rs +++ b/cli/tests/integration/cert_tests.rs @@ -250,13 +250,12 @@ async fn listen_tls_alpn() { let tcp_stream = tokio::net::TcpStream::connect("localhost:4504") .await .unwrap(); - let mut tls_stream = TlsStream::new_client_side(tcp_stream, cfg, hostname); + let mut tls_stream = + TlsStream::new_client_side(tcp_stream, cfg, hostname, None); - tls_stream.handshake().await.unwrap(); + let handshake = tls_stream.handshake().await.unwrap(); - let (_, rustls_connection) = tls_stream.get_ref(); - let alpn = rustls_connection.alpn_protocol().unwrap(); - assert_eq!(alpn, b"foobar"); + assert_eq!(handshake.alpn, Some(b"foobar".to_vec())); let status = child.wait().unwrap(); assert!(status.success()); @@ -300,13 +299,11 @@ async fn listen_tls_alpn_fail() { let tcp_stream = tokio::net::TcpStream::connect("localhost:4505") .await .unwrap(); - let mut tls_stream = TlsStream::new_client_side(tcp_stream, cfg, hostname); + let mut tls_stream = + TlsStream::new_client_side(tcp_stream, cfg, hostname, None); tls_stream.handshake().await.unwrap_err(); - let (_, rustls_connection) = tls_stream.get_ref(); - assert!(rustls_connection.alpn_protocol().is_none()); - let status = child.wait().unwrap(); assert!(status.success()); } -- cgit v1.2.3