Skip to content

Commit

Permalink
remove explicit key log intents and just trust default
Browse files Browse the repository at this point in the history
  • Loading branch information
GlenDC committed Sep 19, 2024
1 parent 0146251 commit c75e62b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions examples/mtls_tunnel_and_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ use rama::{
tls::rustls::server::{TlsAcceptorData, TlsAcceptorLayer},
Context, Layer,
};
use rama_net::tls::KeyLogIntent;

// everything else is provided by the standard library, community crates or tokio
use std::time::Duration;
Expand Down Expand Up @@ -87,10 +86,6 @@ async fn main() {
client_auth: Some(ClientAuth::SelfSigned),
expose_client_cert: true,
server_verify_mode: ServerVerifyMode::Disable,
key_logger: std::env::var("SSLKEYLOGFILE")
.ok()
.map(|f| KeyLogIntent::File(f.into()))
.unwrap_or(KeyLogIntent::Disabled),
..Default::default()
})
.expect("create tls connector data for client");
Expand Down
5 changes: 1 addition & 4 deletions examples/tls_boring_termination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ use rama::{
layer::{ConsumeErrLayer, GetExtensionLayer},
net::forwarded::Forwarded,
net::stream::{SocketInfo, Stream},
net::tls::server::SelfSignedData,
net::tls::server::{ServerAuth, ServerConfig},
net::tls::{server::SelfSignedData, KeyLogIntent},
proxy::haproxy::{
client::HaProxyLayer as HaProxyClientLayer, server::HaProxyLayer as HaProxyServerLayer,
},
Expand Down Expand Up @@ -78,9 +78,6 @@ async fn main() {
ApplicationProtocol::HTTP_2,
ApplicationProtocol::HTTP_11,
]);
if let Ok(keylog_file) = std::env::var("SSLKEYLOGFILE") {
tls_server_config.key_logger = KeyLogIntent::File(keylog_file.into());
}

let acceptor_data = TlsAcceptorData::try_from(tls_server_config).expect("create acceptor data");

Expand Down
11 changes: 2 additions & 9 deletions examples/tls_termination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ use rama::{
},
Context, Layer,
};
use rama_net::tls::{
server::{SelfSignedData, ServerAuth, ServerConfig},
KeyLogIntent,
};
use rama_net::tls::server::{SelfSignedData, ServerAuth, ServerConfig};

// everything else is provided by the standard library, community crates or tokio
use std::{convert::Infallible, time::Duration};
Expand All @@ -83,11 +80,7 @@ async fn main() {
)
.init();

let mut tls_server_config =
ServerConfig::new(ServerAuth::SelfSigned(SelfSignedData::default()));
if let Ok(keylog_file) = std::env::var("SSLKEYLOGFILE") {
tls_server_config.key_logger = KeyLogIntent::File(keylog_file.into());
}
let tls_server_config = ServerConfig::new(ServerAuth::SelfSigned(SelfSignedData::default()));

let acceptor_data = TlsAcceptorData::try_from(tls_server_config).expect("create acceptor data");

Expand Down

0 comments on commit c75e62b

Please sign in to comment.