From c0f690f27345b3c975e89b9afcd8847597b015f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3rebe=20-=20Romain=20GERARD?= Date: Sat, 16 Mar 2024 22:16:33 +0100 Subject: [PATCH] feat(tls): Support SSLKEYLOGFILE env variable --- src/tls.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tls.rs b/src/tls.rs index e507da2..54fd304 100644 --- a/src/tls.rs +++ b/src/tls.rs @@ -12,7 +12,7 @@ use tokio_rustls::client::TlsStream; use tokio_rustls::rustls::client::{ServerCertVerified, ServerCertVerifier}; use crate::tunnel::TransportAddr; -use tokio_rustls::rustls::{Certificate, ClientConfig, PrivateKey, ServerName}; +use tokio_rustls::rustls::{Certificate, ClientConfig, KeyLogFile, PrivateKey, ServerName}; use tokio_rustls::{rustls, TlsAcceptor, TlsConnector}; use tracing::info; @@ -85,6 +85,7 @@ pub fn tls_connector( .with_no_client_auth(); config.enable_sni = enable_sni; + config.key_log = Arc::new(KeyLogFile::new()); // To bypass certificate verification if !tls_verify_certificate { @@ -105,6 +106,7 @@ pub fn tls_acceptor(tls_cfg: &TlsServerConfig, alpn_protocols: Option