From b005b1efbad893850ce1d9672e8c5d771da4921e Mon Sep 17 00:00:00 2001 From: amigin Date: Wed, 24 Apr 2024 07:28:53 +0400 Subject: [PATCH] Fixed accepting TLS Stream --- src/http_server/https_server.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/http_server/https_server.rs b/src/http_server/https_server.rs index 347946d..0768088 100644 --- a/src/http_server/https_server.rs +++ b/src/http_server/https_server.rs @@ -108,7 +108,13 @@ async fn lazy_accept_tcp_stream( println!("Created config"); - let tls_stream = start.into_stream(config.into()).await.unwrap(); + let tls_stream = start.into_stream(config.into()).await; + + if let Err(err) = &tls_stream { + return Err(format!("failed to perform tls handshake: {err:#}")); + } + + let tls_stream = tls_stream.unwrap(); println!("Applied config"); let cn_user_name = if let Some(client_cert_cell) = client_cert_cell {