Repository navigation
Conversation
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>
BoringSSL provides SSL_export_keying_material() with the same signature as OpenSSL; only SSL_export_keying_material_early() is missing. Also, old OpenSSL versions got "BoringSSL does not support SSL_export_keying_material" from both functions instead of "OpenSSL too old", and BoringSSL now gets the right function name for the early one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I hereby granted the copyright of the changes in this pull request
to the authors of this lua-nginx-module project.
Two SSL features were disabled for BoringSSL although BoringSSL provides the APIs they need, in both the build CI uses (boringssl-20230902) and current BoringSSL:
lua_ssl_key_log: BoringSSL always reportsOPENSSL_VERSION_NUMBERas 1.1.1, so the> 1.1.1jcheck leftHAVE_SSL_KEY_LOGundefined. The directive was accepted but silently did nothing. BoringSSL has providedSSL_CTX_set_keylog_callback()for a long time.ngx_http_lua_ffi_ssl_export_keying_material()(ssl.export_keying_material()in lua-resty-core) returned "BoringSSL does not support SSL_export_keying_material". BoringSSL providesSSL_export_keying_material()with the same signature as OpenSSL. OnlySSL_export_keying_material_early()is missing, so that function still refuses, now naming the right function. Old OpenSSL versions also got the BoringSSL message from both functions; they now get "OpenSSL too old".The
lua_ssl_key_logtest int/129-ssl-socket.tmatched 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:t/129-ssl-socket.t,t/139-ssl-cert-by.t,t/140-ssl-c-api.t,t/142,t/143,t/155,t/162,t/166,t/169,t/170-*,t/187,t/193,t/194all pass. lua-resty-core'st/ssl.t,t/ocsp.t,t/ssl-*.t,t/proxy-ssl*.tandt/stream/ssl.talso pass against this build.6ca49385(2023-09-01, the commit behind boringssl-20230902), without HTTP/3:t/129-ssl-socket.tTEST 35 (lua_ssl_key_log) and lua-resty-core'st/ssl.tTEST 31 (export_keying_material) now pass. The other failures in these two files (BoringSSL is not run without HTTP/3 in CI) are the same before and after this change.t/129-ssl-socket.tTEST 35 passes as well.The CI BoringSSL job runs with
TEST_NGINX_USE_HTTP3, which skipst/129-ssl-socket.t. Theexport_keying_materialtest is in lua-resty-core, which has no BoringSSL job. So CI does not exercise either change with BoringSSL.CI on master currently fails to build
ngx_http_lua_shdict.c(since bdd4cad); this branch is based on ab14673, the last green commit.Related: openresty/openresty#1159 (I came across these while looking into AWS-LC support).
🤖 Generated with Claude Code