Skip to content

Commit 1c4d925

Browse files
authored
feat: SSLKEYLOGFILE support for flight CLI (#8239)
# Which issue does this PR close? \- # Rationale for this change This is #4875 now that the upstream changes are available. Allows analysis of TLS traffic with an external tool like Wireshark. See https://wiki.wireshark.org/TLS#using-the-pre-master-secret # What changes are included in this PR? New flag that opts into into the standard `SSLKEYLOGFILE` handling that other libraries and browsers support. # Are these changes tested? Not automatic test, but I did validate that setting the flag AND the env variable emits a log file that is successfully used by Wireshark to decrypt the traffic. # Are there any user-facing changes? Mostly none for normal users, but might be helpful for developers.
1 parent 8c80fe1 commit 1c4d925

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

arrow-flight/src/bin/flight_sql_client.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ struct ClientArgs {
104104
#[clap(long)]
105105
tls: bool,
106106

107+
/// Dump TLS key log.
108+
///
109+
/// The target file is specified by the `SSLKEYLOGFILE` environment variable.
110+
///
111+
/// Requires `--tls`.
112+
#[clap(long, requires = "tls")]
113+
key_log: bool,
114+
107115
/// Server host.
108116
///
109117
/// Required.
@@ -404,7 +412,11 @@ async fn setup_client(args: ClientArgs) -> Result<FlightSqlServiceClient<Channel
404412
.keep_alive_while_idle(true);
405413

406414
if args.tls {
407-
let tls_config = ClientTlsConfig::new().with_enabled_roots();
415+
let mut tls_config = ClientTlsConfig::new().with_enabled_roots();
416+
if args.key_log {
417+
tls_config = tls_config.use_key_log();
418+
}
419+
408420
endpoint = endpoint
409421
.tls_config(tls_config)
410422
.context("create TLS endpoint")?;

0 commit comments

Comments
 (0)