Skip to content

feature: ngx_stream_lua_ffi_req_shared_ssl_ciphers() #378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2025

Conversation

chensunny
Copy link
Contributor

Overview

This pull request introduces a new API to retrieve shared SSL ciphers between the client and server, with optional filtering for GREASE ciphers. It also includes corresponding tests to validate the functionality and error handling. The most important changes are grouped into two themes: API Implementation and Testing Enhancements.

API Implementation:

  • Added a new function ngx_stream_lua_ffi_req_shared_ssl_ciphers in src/ngx_stream_lua_ssl_certby.c to retrieve shared SSL ciphers, with an option to filter out GREASE ciphers. This function handles errors such as invalid requests, insufficient buffer size, and unsupported SSL libraries.
  • Introduced a helper function ngx_stream_lua_is_grease_cipher to identify GREASE cipher IDs based on their pattern.

Related PR

Closed openresty/lua-resty-core#505
Closed openresty/lua-nginx-module#1962
Closed openresty/lua-nginx-module#2424

Testing Enhancements:

  • Declared the new API function in the FFI interface in t/140-ssl-c-api.t to enable Lua integration.
  • Added multiple test cases in t/140-ssl-c-api.t to validate:
    • Retrieval of supported ciphers without GREASE filtering.
    • Retrieval of supported ciphers with GREASE filtering.
    • Proper error handling when no SSL connection is present.

@zhuizhuhaomeng zhuizhuhaomeng merged commit 94e91ae into openresty:master Jul 21, 2025
3 checks passed
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.

2 participants