Kafka SSL hostname verification behavior during DNS failover with ssl.endpoint.identification.algorithm=HTTPS
0 reputation · 06 Jan 2022, 19:53 UTC
0 reputation · 06 Jan 2022, 19:53 UTC
Kafka clients using the default ssl.endpoint.identification.algorithm=HTTPS verify the broker certificate hostname against the DNS name used at connection establishment. The verification occurs once during the initial handshake and is not repeated for the lifetime of that connection.
In environments with DNS-based failover or rolling broker updates, the IP address behind a broker's DNS name can change while client connections remain open. Existing connections continue using the original IP and certificate, but new connections will resolve the updated DNS record and may fail verification if the certificate does not match the new hostname.
There is no built-in mechanism to trigger re-verification or connection refresh when DNS records change. The JVM DNS cache TTL (networkaddress.cache.ttl) further complicates timing, as clients may continue resolving stale IPs even after DNS updates propagate.
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.