Skip to content

Commit 5b755ac

Browse files
committed
fix(kotlin): enable dynamic TLS key logging based on environment variable
1 parent f7bc77e commit 5b755ac

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • kotlin/examples/quic_client/src/main/kotlin

kotlin/examples/quic_client/src/main/kotlin/Main.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ fun main() {
3535
println("QUIC Engine created.")
3636

3737
// 3. TLS options — insecureSkipVerify=true for demo broker only
38+
val enableTlsKeyLog = !System.getenv("SSLKEYLOGFILE").isNullOrBlank()
3839
val tlsOpts = MqttTlsOptionsFfi(
3940
caCertFile = null,
4041
clientCertFile = null,
4142
clientKeyFile = null,
4243
insecureSkipVerify = true,
4344
alpnProtocols = listOf(),
44-
enableKeyLog = true // Enable TLS keylog for debugging QUIC traffic
45+
enableKeyLog = enableTlsKeyLog // Enable TLS keylog for debugging QUIC traffic
4546
)
4647

4748
// 4. Resolve broker and open non-blocking UDP socket

0 commit comments

Comments
 (0)