Expose TLS peer certificate validation status in CEL context etc.
#45,660 opened on Jun 16, 2026
Repository metrics
- Stars
- (27,997 stars)
- PR merge metrics
- (Avg merge 8d) (378 merged PRs in 30d)
Description
In an optional mTLS setting, i.e. where a client may present a certificate, which in turn is accepted even if untrusted (i.e. with verify_trust_chain: ACCEPT_UNTRUSTED), a user is still interested in whether a peer certificate was presented and whether it was valid.
The information whether a certificate was presented is currently already being exposed using the connection.mtls context attribute. The validation status, however, is not. I therefore propose introducing a new context attribute that reflects the validation status in a similar vein, e.g. connection.peer_certificate_valid.
Furthermore, but I'm open to opening a separate issue for this, having a substitution formatter variable like '%DOWNSTREAM_PEER_CERTIFICATE_VALIDATION_STATUS%' that reflects this information would be good to have as well. There could be some predefined values for successful validation, failed validation, and no certificate having been presented. nginx exposes something similar in its ssl_client_verify variable.
Relevant Links: This information is already exposed to the Lua filter, as was introduced in #12174. Making it available in more locations makes it easier to do certain things (such as add a header with this information) without having to resort to the "big guns" of a Lua filter.