Skip to content

bugfix: lua_ssl_key_log did not take effect with BoringSSL. - #417

Open
h2zi wants to merge 1 commit into
openresty:masterfrom
h2zi:boringssl-key-log
Open

h2zi wants to merge 1 commit into
openresty:masterfrom
h2zi:boringssl-key-log

Conversation

@h2zi

@h2zi h2zi commented Nov 2, 2026

Copy link
Copy Markdown

I hereby granted the copyright of the changes in this pull request
to the authors of this stream-lua-nginx-module project.

This is the stream subsystem counterpart of openresty/lua-nginx-module#2543 (the lua_ssl_key_log part).

BoringSSL always reports OPENSSL_VERSION_NUMBER as 1.1.1, so the > 1.1.1j check left HAVE_SSL_KEY_LOG undefined. lua_ssl_key_log was accepted but silently did nothing. BoringSSL has provided SSL_CTX_set_keylog_callback() for a long time, including the boringssl-20230902 build used by lua-nginx-module's CI.

The lua_ssl_key_log test in t/129-ssl-socket.t matched the secrets in the order OpenSSL writes them. BoringSSL writes them in a different order, and the key log file is appended to on every repeated request. The test now keeps the lines of the last handshake (by client random) and sorts them before matching.

Testing

On Ubuntu 22.04 (aarch64), nginx 1.31.8 built with util/build.sh:

CI on master currently fails to build ngx_stream_lua_shdict.c (since 68949e1); this branch is based on 9bc2e1f, the last green commit.

Related: openresty/openresty#1159.

🤖 Generated with Claude Code

BoringSSL always reports OPENSSL_VERSION_NUMBER as 1.1.1, so the version
check left HAVE_SSL_KEY_LOG undefined and the directive was accepted but
silently ignored, although BoringSSL has long provided
SSL_CTX_set_keylog_callback().

The lua_ssl_key_log test now checks the secrets of the last handshake
only, in sorted order: the key log file is appended to on every request,
and BoringSSL logs the secrets in a different order than OpenSSL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant