liveBook · Manning

TLS

As explained in Apache Kafka in Action

Transport Layer Security (TLS) is a cryptographic protocol that provides authenticated, encrypted communication and protects network traffic from eavesdropping and tampering.

TLS protects Kafka traffic with encryption and authenticated connections. It is typically applied to both client–broker and broker–broker communication, making transport encryption a baseline requirement rather than an optional enhancement. section 13.2.1 section 13.4

A broker receives a public–private key pair signed by a central Certificate Authority (CA). Its keystore stores the private key, while a truststore containing the CA public key lets clients and brokers verify trusted peers. TLS improves protection but adds configuration work and can reduce performance, so heavily loaded clusters should be tested before migration. section 13.2.1

listeners=PLAINTEXT://$IP:9092,SSL://$IP:9093 #1
listener.security.protocol.map=\
    PLAINTEXT:PLAINTEXT,SSL:SSL #2
ssl.keystore.location=/home/user/certs/broker.ks.p12 #3
ssl.keystore.type=PKCS12  #3
ssl.keystore.password=keystore-pw  #3
ssl.key.password=keystore-pw  #3
ssl.truststore.location=\
    /home/user/certs/ca.truststore.p12 #4
ssl.truststore.password=truststore-pw  #4
ssl.truststore.type=PKCS12  #4

Use the configuration listing as a starting point for a transition: expose both PLAINTEXT and SSL listeners, map their protocols, and configure PKCS12 keystores and truststores. section 13.2.1

Migrating an existing cluster

A Kafka environment that currently communicates without security can add encrypted listeners alongside unencrypted ones, reconfigure clients and brokers, and restart brokers sequentially. This supports migration without affecting availability, while performance testing reveals whether TLS overhead is acceptable. section 13.2.1 section 13.4

How Apache Kafka in Action covers it

How deep it goes
Explains keys, certificate authorities, keystores, truststores, listeners, and performance trade-offs, but defers detailed keytool commands.
Examples
Uses dual PLAINTEXT and SSL listeners, PKCS12 broker stores, CA truststores, and sequential cluster migration as concrete examples.
What it assumes
Introduces asymmetric cryptography and Kafka TLS stores while assuming familiarity with Kafka brokers, clients, and listeners.
What you can do after
Operate/configure encrypted Kafka communication and plan a gradual migration while checking configuration and performance risks.
How it connects
Connects transport encryption with asymmetric cryptography, certificate authorities, keystores, truststores, authentication, authorization, and Kafka listeners.

Also explained in

Compare how 15 books explain TLS →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Apache Kafka in Action. The section links point to the parts of the book it draws on.