ubuntu confluent Kafka python -证书验证

owfi6suc  于 10个月前  发布在  Kafka
关注(0)|答案(1)|浏览(112)

我在Windows上使用了simple producer,但当我尝试在Ubuntu上运行时,我得到了:

SSL handshake failed: error:0A000086:SSL routines::certificate verify failed: broker certificate could not be verified, verify that ssl.ca.location is correctly configured or root CA certificates are installed (install ca-certificates package) (after 5ms in state SSL_HANDSHAKE)

字符串
librdkafka docs说关于ssl.ca.location:
用于验证代理密钥的CA证书的文件或目录路径。默认值:在Windows上,系统的CA证书会自动在Windows根证书存储中查找。在Linux上安装发行版的ca-certificates包。
我没有找到任何信息如何从Windows证书存储中获取正确的证书并将其传输到Ubuntu服务器。你能帮助我如何获得正确的证书,使生产者在Ubuntu上工作,请?

from confluent_kafka import Producer
kafka_config = {
'bootstrap.servers': 'kafka...:9092, ... , kafka:9092',
'client.id': socket.gethostname(),
'security.protocol': 'SSL',
'ssl.key.location': '/path/to/kafka-keystore.key.pem',
'ssl.key.password': '12345',
'ssl.certificate.location': '/path/to/kafka-keystore.crt.pem'
}
producer = Producer(kafka_config)

lyr7nygr

lyr7nygr1#

我通过Keystore Explorer从.jks导入.cer文件,并将其路径放入ssl.ca.location中。

相关问题