gpt4 book ai didi

python-3.x - 在 python 中为 Kafka 代理指定 SSL 详细信息

转载 作者:太空宇宙 更新时间:2023-11-03 14:32:32 24 4
gpt4 key购买 nike

我需要使用 SSL 连接到具有多个代理的 kafka 实例。我正在使用 kafka-python 来消费和处理数据。

我看到他们使用 kafka-python 通过 SSL 连接到单个代理的链接。

链接:http://maximilianchrist.com/python/databases/2016/08/13/connect-to-apache-kafka-from-python-using-ssl.html

具体代码

consumer = KafkaConsumer(bootstrap_servers='my.server.com',
security_protocol='SSL',
ssl_check_hostname=True,
ssl_cafile='CARoot.pem',
ssl_certfile='certificate.pem',
ssl_keyfile='key.pem')

我需要知道因为有多个代理如何在构造函数中指定多个 ssl_ca、ssl_cert、ssl_key ??

最佳答案

应设置 SSL,以便客户端可以通过您的任何代理进行身份验证。我建议您查看本教程以更好地了解 SSL 基础知识 https://docs.confluent.io/current/kafka/encryption.html#kafka-ssl-encryption

关于python-3.x - 在 python 中为 Kafka 代理指定 SSL 详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51398235/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com