trafficserver
trafficserver copied to clipboard
Add support for retrieving cert info in lua plugin
This pull request adds comprehensive Lua API documentation and helper functions for extracting X.509 certificate data in the ATS Lua plugin. The main changes include new documentation for both client and server certificate accessors and a set of helper functions to retrieve certificate fields such as PEM encoding, subject, issuer, serial number, validity dates, signature, version, and Subject Alternative Names (SANs).
Documentation enhancements:
- Added detailed documentation for new Lua API functions to access client and server certificate fields, including PEM, subject, issuer, serial, signature, validity dates, version, and various SAN types. Each function includes syntax, context, description, return values, and usage examples in
doc/admin-guide/plugins/lua.en.rst.
Helper functions for certificate extraction:
- Implemented helper functions in
ts_lua_client_cert_helpers.hfor extracting certificate data such as subject/issuer names (RFC2253), serial number, validity timestamps, PEM encoding, signature (hex string), and SAN entries (DNS, IP, email, URI) from X.509 certificates. These functions use OpenSSL APIs and handle both client and server certificates.
This is trying to provide similar functionality as #12320 and #12363