尝试使用双向SSL建立Kafka,但出现错误

尝试使用双向SSL建立Kafka,但出现错误,ssl,apache-kafka,sslhandshakeexception,Ssl,Apache Kafka,Sslhandshakeexception,我正在尝试使用Kafka(版本2.4.0)建立双向TLS身份验证 My server.properties配置: listeners=SSL://kafka1:9092 advertised.listeners=SSL://<public_ip>:9092 ssl.keystore.location=path/server.keystore.jks ssl.keystore.password=pass ssl.truststore.location=path/server.trust

我正在尝试使用Kafka(版本2.4.0)建立双向TLS身份验证

My server.properties配置:

listeners=SSL://kafka1:9092
advertised.listeners=SSL://<public_ip>:9092
ssl.keystore.location=path/server.keystore.jks
ssl.keystore.password=pass
ssl.truststore.location=path/server.truststore.jks
ssl.truststore.password=pass
ssl.endpoint.identification.algorithm=HTTPS
security.inter.broker.protocol=SSL
kafkaServer和zooKeeper已启用。 但当我尝试创建主题时:

kafka-topics.sh--引导服务器kafka1:9092--创建--复制因子1--分区1--主题sometopic--命令配置/client.properties

获取一个错误:

org.apache.kafka.common.errors.SslAuthenticationException: SSL handshake failed
Caused by: javax.net.ssl.SSLHandshakeException: No name matching kafka1 found
我的证书连接到kafka1名称,并且有kafka1到本地ip的映射。
您以前见过这样的错误吗?

这看起来像是在docker compose集合中运行的?您还需要宣传
kafka1
侦听器,并且需要在其中一个容器中运行
kafka topics.sh
,以便它找到
kafka1
服务。我没有使用docker。你能解释一下作为一名听众,我需要做什么样的广告吗?你提到的那个容器是什么?谢谢你的帮助。
org.apache.kafka.common.errors.SslAuthenticationException: SSL handshake failed
Caused by: javax.net.ssl.SSLHandshakeException: No name matching kafka1 found