feature: ssl.get_shared_ssl_ciphers() #505
Open
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.
SSL Shared Ciphers Implementation Summary
Overview
This implementation adds the
get_shared_ssl_ciphers()
function to lua-resty-core's SSL module, corresponding to thengx_http_lua_ffi_req_shared_ssl_ciphers
function from PR #2424 in lua-nginx-module.🔗 Related Issues
Closed openresty/lua-nginx-module#1962
Closed openresty/lua-nginx-module#2424
Files Modified
1.
/lib/ngx/ssl.lua
ngx_http_lua_ffi_req_shared_ssl_ciphers
ngx_stream_lua_ffi_req_shared_ssl_ciphers
ngx_lua_ssl_ciphers
with flexible arrayffi_copy
,ffi_sizeof
,ffi_typeof
,ffi_new
,format
,concat
get_shared_ssl_ciphers()
function indo...end
block with:ipairs()
iteration with detailed cipher informationtostring()
for formatted cipher lists__index
2.
/lib/ngx/ssl.md
ipairs()
and rich cipher information3.
/t/ssl.t
ciphers.nciphers
propertyipairs()
iteration withcipher_info.iana_name
4.
/examples/ssl_shared_ciphers.lua
ciphers.nciphers
,ipairs()
, andtostring()
Function Details
Signature:
ciphers = ssl.get_shared_ssl_ciphers()
Behavior:
Returned Object:
ciphers.nciphers
: Number of shared ciphersipairs()
iteration with detailed cipher infotostring()
for formatted cipher listError Handling:
nil, error_string
on failureImplementation Notes
ngx_lua_ssl_ciphers
with flexible arrayipairs()
andtostring()
through metatypeTesting
luac -p
Key Improvements Over Initial Design
The implementation has been significantly enhanced based on user feedback:
ipairs()
andtostring()
supportdo...end
blockThis implementation provides the lua-resty-core API for the SSL cipher enumeration functionality added in lua-nginx-module PR #2424, with significant enhancements for usability and functionality.