0

I have a confluent Kafka consumer code using Python. I also have the truststore ca files including: certificate.jks and chain_certificate.pem. I know that we I am not able to use .jks file in python code and the PEM file that I have is a chain file (a single .pem file). My config code is as bellow:

from confluent_kafka import Consumer

consumer = Consumer({'bootstrap.servers':'myserver',
                     'security.protocol':'SSL',
                     'ssl.truststore.type':'PEM',
                     'ssl.truststore.location': 'chain_certificate.pem',
                     'ssl.truststore.password':'mypass',
                     'group.id':'test'
                     })

I have tried multiple options like adding the ssl.check.hostname = False/True, but every time I am getting different errors and I'm not able to connect to the broker and topic.

'ssl.truststore.password' : 'mypass' cimpl.kafkaException: kafkaError{code=_INVALID_ARG, val=-186, str="No such configuration property:ssl.trusstore.type""} .

However, when I remove the ssl.truststore.type it gives the same error with just 'ssl.truststore.password' : 'mypass' cimpl.kafkaException: kafkaError{code=_INVALID_ARG, val=-186, str="Java truststore are not supported, use 'ssl.ca.location' and a certification file instead.""}

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • Can you share what errors you get? – Rohan Dec 11 '22 at 21:14
  • look at this : https://github.com/confluentinc/confluent-kafka-python/issues/944 – eshirvana Dec 12 '22 at 03:24
  • The valid properties you can set are defined here - https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md and for SSL https://github.com/edenhill/librdkafka/wiki/Using-SSL-with-librdkafka – OneCricketeer Dec 12 '22 at 21:36

0 Answers0