fix(redis): send the TLS SNI and add redis_server_name - #13938
Conversation
membphis
left a comment
There was a problem hiding this comment.
[P2] Document the hostname verification change and upgrade path
Defaulting server_name to a DNS redis_host also enables certificate hostname matching when redis_ssl_verify is true. Previously, a connection could pass certificate-chain verification even when the configured DNS alias was not covered by the certificate. That existing configuration can now fail with certificate host mismatch after upgrading.
Please retain the hostname verification, explicitly document the affected configuration and migration path, and explain how to set redis_server_name to a name covered by the certificate. Please also add a regression case showing that a mismatched default hostname fails while an explicit matching override succeeds.
Evidence: apisix/utils/redis.lua and apisix/plugins/limit-count/util.lua pass conf.redis_server_name or conf.redis_host to the TLS handshake for non-IP names. The current description explains the SNI default and IP compatibility, but does not explain this DNS-alias upgrade scenario.
540e78d
Description
redis_ssl: truenever set the TLS SNI, so Redis behind a name-routed TLS front (a cloud endpoint on 443) got the default vhost and the plugin failed withunknown prefix: "72".This builds on #13935 (
redis_server_nameoption, SNI defaults toredis_host, SNI isolated in the keepalive pool) and adds:redis_ssl_verify: truewith an IP host starts failing on the hostname check (regression against 3.18.0)t/utils/redis-sni.t: end-to-end tests against real TLS fronts, replacing the mockedt/utils/redis.tWhich issue(s) this PR fixes:
Fixes #13926
Checklist