简体   繁体   English

基于 TLS 的 Kafka mqtt-connector

[英]Kafka mqtt-connector over TLS

I need help because I'm new about kafka and mqtt.我需要帮助,因为我对 kafka 和 mqtt 不熟悉。 I'im using docker compose to create an architecture for the communication between Mosquitto broker and Kakfa我正在使用 docker compose 为 Mosquitto 代理和 Kakfa 之间的通信创建架构

I'm also using the connector provided by confluent Kafka Connect MQTT ( https://www.confluent.io/hub/confluentinc/kafka-connect-mqtt )我也在使用 confluent Kafka Connect MQTT 提供的连接器( https://www.confluent.io/hub/confluentinc/kafka-connect-mqtt

It work well for the commnunication over port 1883 but whe I tried to use MQTT connection over port 8883, it fails because it can't find any certificate.它适用于端口 1883 上的通信,但是当我尝试通过端口 8883 使用 MQTT 连接时,它失败了,因为它找不到任何证书。

Does anyone know how configure Kafka Connect MQTT?有谁知道如何配置 Kafka Connect MQTT? what kind of certificates are necessry (*.crt doesn't work)?需要什么样的证书(*.crt 不起作用)?

Thanks in advance, Luca在此先感谢,卢卡

The question is a bit old but as I run into the same issue recently, I put the solution here in case it help someone in the future:这个问题有点老了,但是当我最近遇到同样的问题时,我把解决方案放在这里,以防将来对某人有所帮助:

You have to create a TrustStore file using keytool and put your certificate inside:您必须使用keytool创建一个 TrustStore 文件并将您的证书放入:

keytool -import -file C:\cascerts\CA.cert -alias CA -keystore myTrustStore

You will be prompt to set a password for the TrustStore.系统将提示您为 TrustStore 设置密码。

Then in the MQTT connector properties file put the SSL config:然后在 MQTT 连接器属性文件中放入 SSL 配置:

# SSL
mqtt.ssl.trust.store.path=myTrustStore
mqtt.ssl.trust.store.password=password
mqtt.ssl.key.store.path=myTrustStore
mqtt.ssl.key.store.password=password

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM