Skip to content

Commit

Permalink
Add SSLKEYLOGFILE support (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
g2p authored Mar 4, 2024
1 parent d9e6758 commit 8d57d22
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ impl<'a> CastDevice<'a> {
log::debug!("Successfully parsed {valid} root certificates.");
}

let config = ClientConfig::builder()
let mut config = ClientConfig::builder()
.with_root_certificates(root_store)
.with_no_client_auth();
config.key_log = Arc::new(rustls::KeyLogFile::new());

let conn = ClientConnection::new(
config.into(),
Expand Down Expand Up @@ -158,10 +159,11 @@ impl<'a> CastDevice<'a> {

log::debug!("Establishing non-verified connection with cast device at {host}:{port}…");

let config = ClientConfig::builder()
let mut config = ClientConfig::builder()
.dangerous()
.with_custom_certificate_verifier(Arc::new(NoCertificateVerification {}))
.with_no_client_auth();
config.key_log = Arc::new(rustls::KeyLogFile::new());
let stream = StreamOwned::new(
ClientConnection::new(
Arc::new(config),
Expand Down

0 comments on commit 8d57d22

Please sign in to comment.