feat: TLS 1.3 session resumption

This commit is contained in:
link2xt
2024-11-07 19:22:19 +00:00
committed by l
parent 460d2f3c2a
commit eb1bd1d200
7 changed files with 179 additions and 24 deletions

View File

@@ -76,11 +76,13 @@ where
let proxy_stream = proxy_config
.connect(context, host, port, load_cache)
.await?;
let tls_stream = wrap_rustls(host, "", proxy_stream).await?;
let tls_stream =
wrap_rustls(host, port, "", proxy_stream, &context.tls_session_store).await?;
Box::new(tls_stream)
} else {
let tcp_stream = crate::net::connect_tcp(context, host, port, load_cache).await?;
let tls_stream = wrap_rustls(host, "", tcp_stream).await?;
let tls_stream =
wrap_rustls(host, port, "", tcp_stream, &context.tls_session_store).await?;
Box::new(tls_stream)
}
}