From 52777754623628f91ee2316acee52e68831f3e02 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Mon, 8 Jun 2020 12:47:05 +0100 Subject: quiche: update SSLKEYLOGFILE support quiche now requires the application to explicitly set the keylog path for each connection, rather than reading the environment variable itself. Closes #5541 --- lib/vquic/quiche.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/vquic/quiche.c b/lib/vquic/quiche.c index 436249522..9af2d894f 100644 --- a/lib/vquic/quiche.c +++ b/lib/vquic/quiche.c @@ -158,6 +158,7 @@ CURLcode Curl_quic_connect(struct connectdata *conn, curl_socket_t sockfd, CURLcode result; struct quicsocket *qs = &conn->hequic[sockindex]; struct Curl_easy *data = conn->data; + char *keylog_file = NULL; #ifdef DEBUG_QUICHE /* initialize debug log callback only once */ @@ -195,7 +196,9 @@ CURLcode Curl_quic_connect(struct connectdata *conn, curl_socket_t sockfd, if(result) return result; - if(getenv("SSLKEYLOGFILE")) + keylog_file = getenv("SSLKEYLOGFILE"); + + if(keylog_file) quiche_config_log_keys(qs->cfg); qs->conn = quiche_connect(conn->host.name, (const uint8_t *) qs->scid, @@ -205,6 +208,9 @@ CURLcode Curl_quic_connect(struct connectdata *conn, curl_socket_t sockfd, return CURLE_OUT_OF_MEMORY; } + if(keylog_file) + quiche_conn_set_keylog_path(qs->conn, keylog_file); + /* Known to not work on Windows */ #if !defined(WIN32) && defined(HAVE_QUICHE_CONN_SET_QLOG_FD) { -- cgit v1.2.3