The Kafka administrator exam frequently tests listener design, mutual authentication (mTLS), certificate handling, and verification/operations procedures. This article sticks to stable concepts from the official documentation so the material works for both the exam and production.
As a baseline, Kafka can protect both broker↔client and broker↔broker traffic with TLS. The underlying principles are the same whether you use ZooKeeper or KRaft mode: certificate validity, SAN values, and listener consistency are what matter.
Kafka can apply TLS to both client traffic and inter-broker replication. The two points that tend to trip people up on the exam and in practice are which listener carries which path, and how certificate trust is wired up.
At minimum, configure the client-facing listener as SSL or SASL_SSL and also encrypt the internal replication listener referenced by inter.broker.listener.name. Each broker gets its own key and SAN entries, all signed by a single trusted CA.
A high-level view of Kafka TLS placement
Per-broker certificate requirements at a glance
# 各ブローカーで固有の鍵/証明書
# SAN に FQDN (例: broker1.example.com) と必要なら IP を含める
# すべて同じ信頼された CA で署名
# truststore には中間 CA を含めて完全なチェーンを構成Kafka can expose multiple listeners. Separate client-facing and broker-to-broker listeners, and reference the latter via inter.broker.listener.name. Which protocol each listener uses is defined in listener.security.protocol.map.
advertised.listeners is the public address clients use when connecting. The hard rule is that it must match the certificate's SAN, otherwise hostname verification fails.
Representative server.properties (client and internal listeners separated)
listeners=INTERNAL://0.0.0.0:9092,EXTERNAL://0.0.0.0:9093
advertised.listeners=INTERNAL://broker1.example.com:9092,EXTERNAL://broker1.example.com:9093
listener.security.protocol.map=INTERNAL:SSL,EXTERNAL:SSL
inter.broker.listener.name=INTERNAL
# TLS 共通設定(JKS/PKCS12 どちらでも可。近年は PEM もサポートされるが試験では JKS/PKCS12 が無難)
ssl.keystore.location=/var/private/ssl/kafka.broker1.p12
ssl.keystore.password=${FILE:/etc/kafka/keystore.pass}
ssl.keystore.type=PKCS12
ssl.truststore.location=/var/private/ssl/kafka.truststore.p12
ssl.truststore.password=${FILE:/etc/kafka/truststore.pass}
ssl.truststore.type=PKCS12
# クライアント向けリスナーで相互認証を要求する場合
ssl.client.auth=requiredChoose the mode based on the use case: one-way TLS that encrypts with server certificates only, mTLS that also requires client certificates, or SASL (PLAIN/SCRAM/OAUTHBEARER) layered on top of TLS.
The administrator exam tests whether you can identify, for each mode, what is being proven, which stores are needed, and which settings are critical.
| Mode | Who is authenticated | Required stores/certs | Typical use cases / caveats |
|---|---|---|---|
| SSL (one-way) | Server only | Client: truststore / Server: keystore+cert | Encryption is required, but client identity is managed by other means. |
| SSL (mTLS) | Mutual (server + client) | Client: truststore+keystore / Server: truststore+keystore | Best for strict network perimeters; distributing and rotating client certificates is the main operational cost. |
| SASL_SSL (SCRAM) | SASL username/password | Client: truststore / Server: keystore+cert (SASL managed separately) | Users can be managed inside Kafka, and certificate distribution is lighter than with mTLS. |
| PLAINTEXT (reference) | None | None | Not recommended for the exam or for production. Limit to PoCs or isolated networks. |
Minimal additional broker-side settings for SASL_SSL (SCRAM)
# 例: INTERNAL は SSL、EXTERNAL を SASL_SSL に
listener.security.protocol.map=INTERNAL:SSL,EXTERNAL:SASL_SSL
listeners=INTERNAL://0.0.0.0:9092,EXTERNAL://0.0.0.0:9094
advertised.listeners=INTERNAL://broker1.example.com:9092,EXTERNAL://broker1.example.com:9094
inter.broker.listener.name=INTERNAL
# SASL 関連
sasl.enabled.mechanisms=SCRAM-SHA-512
listener.name.external.scram-sha-512.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required;
# 注意: 実際のユーザ作成は kafka-configs.sh --alter --add-config 'SCRAM-SHA-512=[password=...]' などで実施Each broker carries its own private key and certificate signed by a trusted CA. Always include the FQDN in the SAN and keep it consistent with advertised.listeners. Crucially, store the full chain — including intermediate CAs — in the truststore.
Rotate in a rolling fashion: first add the new CA to the truststore → distribute the new certificates → restart nodes one by one. Manage passwords and file permissions with least privilege.
Representative steps with keytool/openssl
# 1) キーストア作成と鍵・CSR 生成(PKCS12)
keytool -genkeypair -alias broker1 -keyalg RSA -keystore kafka.broker1.p12 -storetype PKCS12 -storepass changeit -keypass changeit -dname "CN=broker1.example.com, OU=Kafka, O=Example, L=Tokyo, C=JP" -ext SAN=DNS:broker1.example.com,IP:10.0.0.11
keytool -certreq -alias broker1 -keystore kafka.broker1.p12 -storepass changeit -file broker1.csr -ext SAN=DNS:broker1.example.com,IP:10.0.0.11
# 2) CA で署名し、CA ルート/中間と一緒にインポート
keytool -importcert -alias CARoot -file ca-root.crt -keystore kafka.broker1.p12 -storepass changeit -noprompt
keytool -importcert -alias CAInt -file ca-int.crt -keystore kafka.broker1.p12 -storepass changeit -noprompt
keytool -importcert -alias broker1 -file broker1.signed.crt -keystore kafka.broker1.p12 -storepass changeit
# 3) truststore 作成(CA チェーンを格納)
keytool -importcert -alias CARoot -file ca-root.crt -keystore kafka.truststore.p12 -storetype PKCS12 -storepass changeit -noprompt
keytool -importcert -alias CAInt -file ca-int.crt -keystore kafka.truststore.p12 -storetype PKCS12 -storepass changeit -noprompt
# 4) 検証
keytool -list -v -keystore kafka.broker1.p12 -storepass changeit | grep -E "Alias name|Owner|Issuer|SubjectAlternativeName"The minimum client configuration is security.protocol plus a truststore. When connecting to a broker that requires mTLS, the client also needs a keystore. Hostname verification is on by default (ssl.endpoint.identification.algorithm=HTTPS), so the certificate's SAN must match the connection hostname.
openssl s_client is the go-to tool for first-pass connectivity triage. It immediately surfaces certificate chain and hostname verification failures.
client.properties example and connection verification
# client.properties(単方向 TLS)
bootstrap.servers=broker1.example.com:9093,broker2.example.com:9093
security.protocol=SSL
ssl.truststore.location=/etc/client/kafka.truststore.p12
ssl.truststore.password=${FILE:/etc/client/trust.pass}
ssl.truststore.type=PKCS12
ssl.endpoint.identification.algorithm=HTTPS
# mTLS で必要な追加
ssl.keystore.location=/etc/client/client.p12
ssl.keystore.password=${FILE:/etc/client/key.pass}
ssl.keystore.type=PKCS12
# openssl で事前検証(SNI とホスト名検証の観点で FQDN を使う)
openssl s_client -connect broker1.example.com:9093 -servername broker1.example.com -showcertsThe most common failures are SAN/hostname mismatches, incomplete chains, inconsistent inter.broker.listener.name settings, expired certificates, and password mismatches. Look in the logs for javax.net.ssl.SSLHandshakeException, certificate_unknown, and handshake_failure.
Mapping ACLs to certificate principal names is another exam favorite. When you need to shorten the DN authenticated by mTLS into a principal name, use ssl.principal.mapping.rules.
Commonly used verification commands and settings
# ブローカーの SSL ハンドシェイクエラーを抽出
grep -E "SSLHandshakeException|handshake_failure|certificate_unknown" /var/log/kafka/server.log
# 証明書の SAN を確認
keytool -list -v -keystore /var/private/ssl/kafka.broker1.p12 -storepass changeit | grep -A2 "SubjectAlternativeName"
# mTLS で DN から主体名を抽出するマッピング例(CN を user とする)
ssl.principal.mapping.rules=RULE:^CN=(.*?),.*$/$1/,DEFAULTCCAAK
問題 1
In a production cluster, you want clients to use mTLS and inter-broker traffic to use SSL (mutual authentication). Which combination of settings is correct?
正解: A
Requiring mTLS means ssl.client.auth=required and a keystore on the client side. Inter-broker traffic must run over the listener referenced by inter.broker.listener.name, and that listener must be SSL. B leaves traffic unencrypted, C makes inter-broker traffic PLAINTEXT, and D leaves the client side PLAINTEXT — all incorrect.
Should I use PEM or JKS/PKCS12?
Recent Kafka versions support PEM, but the admin exam and most enterprise standards assume JKS/PKCS12. Match whichever format your operations team has standardized on, and for exam prep make sure you can confidently walk through the JKS/PKCS12 workflow (keytool, truststore/keystore).
Why is advertised.listeners so important?
It is the connection address clients receive back from a broker, and TLS hostname verification compares this value against the certificate's SAN. A mismatch produces an SSLHandshakeException. Always set a FQDN that resolves from the client side.
Should I choose mTLS or SASL_SSL?
mTLS works well for zero-trust or strict network-perimeter environments. If you want to keep client distribution and rotation overhead low, SASL_SSL (e.g. SCRAM) is the more common choice. When you need both, separate them onto different listeners.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Kafka Topics & Partitions: Distribution Fundamentals (2026)
How Kafka topics and partitions enable scale — ordering guar...
CCDAK Exam Guide: Confluent Certified Developer (2026)
Complete prep for the CCDAK exam — Producer/Consumer API, St...
CCAAK Exam Guide: Confluent Certified Administrator (2026)
Pass the CCAAK exam — cluster management, partitions, securi...
Kafka Replicas & ISR: Fault Tolerance Explained (2026)
Replica placement, in-sync replicas (ISR), leader election. ...
Kafka Offsets: Commit Modes & Consumer Position (2026)
Offset semantics — auto vs. manual commit, __consumer_offset...