summaryrefslogtreecommitdiff
path: root/cli/tests/integration/cert_tests.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-11-15 16:12:46 -0700
committerGitHub <noreply@github.com>2023-11-15 16:12:46 -0700
commit6b42cecc064d01d87aae978ecd7eb372bfe9a34e (patch)
tree3fb7f0e4be0c1e8184dde61f96324c7a8419d6b9 /cli/tests/integration/cert_tests.rs
parent40726721e287b2d6c44839d9081dccb408886cab (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 'cli/tests/integration/cert_tests.rs')
-rw-r--r--cli/tests/integration/cert_tests.rs15
1 files changed, 6 insertions, 9 deletions
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());
}