AlinsRan opened a new pull request, #14258:
URL: https://github.com/apache/apisix/pull/14258

   ### Description
   
   The TCP outputs of `tcp-logger` and `error-log-logger` performed the TLS 
handshake without verifying the receiver certificate.
   
   This PR adds a `tls_verify` option, defaulting to `true`, to `tcp-logger` 
and to the `tcp` output of `error-log-logger`. With verification on, the 
certificate chain is checked against `apisix.ssl.ssl_trusted_certificate`. The 
name is checked against `tls_options` for `tcp-logger` or `tcp.tls_server_name` 
for `error-log-logger`, and falls back to the destination host when unset. 
Setting `tls_verify: false` keeps the previous handshake, without the host 
fallback for SNI. The option has no effect when `tls` is off.
   
   `error-log-logger` keeps keepalive connections, so verified and unverified 
TLS connections use separate pools. `tcp-logger` closes every connection after 
sending.
   
   The Vector fixture now serves the trusted test certificate, whose names 
include `test.com`, and the existing TLS cases in `t/plugin/tcp-logger.t` set 
`tls_options: test.com`. The docs now describe `tls` as enabling TLS rather 
than verification, and document `tls_verify`.
   
   Upgrade note: a TLS receiver whose certificate is not trusted, or does not 
match the expected name, no longer receives logs. Before upgrading, either add 
the CA to `apisix.ssl.ssl_trusted_certificate` and set the expected name, or 
set `tls_verify: false`.
   
   The new `t/plugin/tcp-logger-tls.t` runs against a local receiver:
   
   - Both outputs deliver logs to a receiver with a trusted certificate and 
matching name.
   - Both outputs reject a mismatched certificate. These cases fail on master.
   - Both outputs accept the mismatch with `tls_verify: false`.
   - `tcp-logger` with `tls_verify: true` still delivers over plain TCP.
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added to this PR
   - [x] I have added tests corresponding to this change
   - [x] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backward compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to