Rest 如何使用SSL保护kafka connect群集?

Rest 如何使用SSL保护kafka connect群集?,rest,ssl,apache-kafka,apache-kafka-connect,Rest,Ssl,Apache Kafka,Apache Kafka Connect,我正在运行通过SSl加密保护的3节点kafka群集。现在,我尝试使用kafka connect构建一个数据管道,以连接到任何源数据库(mongoDB、Cassandra)。 作为此过程的一部分,首先,我尝试使用以下connect-distributed.properties文件的配置将kafka connect集成到kafka broker- bootstrap.servers=167.67.45.142:30056 group.id=connect-cluster key.converter=

我正在运行通过SSl加密保护的3节点kafka群集。现在,我尝试使用kafka connect构建一个数据管道,以连接到任何源数据库(mongoDB、Cassandra)。 作为此过程的一部分,首先,我尝试使用以下connect-distributed.properties文件的配置将kafka connect集成到kafka broker-

bootstrap.servers=167.67.45.142:30056
group.id=connect-cluster
key.converter=org.apache.kafka.connect.json.JsonConverter
value.converter=org.apache.kafka.connect.json.JsonConverter
key.converter.schemas.enable=true
value.converter.schemas.enable=true
offset.storage.topic=connect-offsets
offset.storage.replication.factor=3
offset.storage.partitions=3
config.storage.topic=connect-configs
config.storage.replication.factor=3
config.storage.partitions=3
status.storage.topic=connect-statuses
status.storage.replication.factor=3
status.storage.partitions=3
offset.flush.interval.ms=10000
rest.host.name=connectcluster-0
rest.port=8083
security.protocol=ssl
ssl.trustore.location=/tmp/kafka.truststore.jks
ssl.truststore.password=password

producer.security.protocol=SSL
producer.ssl.truststore.location=/tmp/kafka.truststore.jks
producer.ssl.truststore.password=password

consumer.security.protocol=SSL
comumer.ssl.truststore.location=/tmp/kafka.truststore.jks
consumer.ssl.truststore.password=password

ssl.endpoint.identification.algorithm=
plugin.path=/var/lib/plugin-connectors/
使用以上配置参数,我启动了连接服务,它工作正常

作为使用SSL保护connect cluster的下一步的一部分,请在connect-distributed.properties文件中添加进一步的配置更改,如下所示:-

listeners=https://connectcluster-0:8443
rest.advertised.listener=https
rest.advertised.host.name=connectcluster-0
rest.advertised.port=8083

ssl.keystore.location=/tmp/kafka.keystore.jks
ssl.keystore.password=password
ssl.key.password=password
我一直在关注卡夫卡连接(kafka connect)的一节——SSL加密(Encryption with SSL)

之后,当我启动卡夫卡连接过程时,它成功启动

当我试图通过-
curl访问connect rest服务时https://connectcluster-0:8443/

我收到
curl:(60)SSL证书问题:证书链中的自签名证书…

还尝试在curl-
curl--cacert client.cer.pem中传递证书https://connectcluster-0:8443/

获取
curl:(50)SSL:没有其他证书使用者名称与目标主机名“connectcluster-0”匹配

如果所需kafka connect配置参数中缺少某些内容,请告知我


如何保护我的kafka connect端点,使其只能通过https://协议访问?

您是否查看了
listeners=https
的配置选项?是的,kafka connect是否也需要一套单独的ssl证书??生产者、消费者、,模式注册表客户端都可以使用不同于Connect Worker的证书,YesPL让我知道,我们可以在Connect distributed.properties中传递哪些特定的配置参数??所以连接端点可以使用https??我再次猜测,为此,我必须创建信任库和密钥库??尝试了一个技巧-在kafka的/etc/hosts文件中使用kafka broker LB ip和证书DNS/CN名称进行更改,以便能够创建连接器,在其他集群中工作正常,但在集群中我无法访问服务,看起来更像是网络或主机端点验证问题。有什么想法,请评论?