Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add SSLKEYLOGFILE support #25

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading