edenhill / kcat

Generic command line non-JVM Apache Kafka producer and consumer
Other
5.46k stars 484 forks source link

Kafkacat with SSL #247

Closed Dwijad closed 4 years ago

Dwijad commented 4 years ago

Hi

I have used the following command to connect ccloud kafka broker using SSL

kafkacat -b ${CCLOUD_BOOTSTRAP_SERVER} -L -X security.protocol=SASL_SSL -X sasl.mechanisms=PLAIN \
 -X sasl.username=${CCLOUD_API_KEY} -X sasl.password=${CCLOUD_API_SECRET} \
 -X api.version.request=true -X ssl.ca.location=/root/cert/ca.cert.pem -d broker,topic,fetch

But i am getting the following error: % ERROR: Failed to acquire metadata: Local: Broker transport failure

I have used the following procedure to create root CA in pem format.

 # openssl genrsa -aes256 -out ca.key.pem 4096
 # chmod 400 ca.key.pem
 # openssl req -config /etc/ssl/openssl.cnf -key ca.key.pem -new -x509 -days 7300 -subj "/C=US/ST=CA/L=San Jose/O=Company/OU=Org/CN=kafka-client.mydomain.com" -sha256 -out ca.cert.pem
 # chmod 444 ca.cert.pem

From the output of kafkacat, i can see the line failed: err: Local: SSL error: (errno: Success) which means there are errors in the steps of creating root CA certificate generation process that i am unable to pinpoint.

Looking forward for a response.

Regards

log.txt

Dwijad commented 4 years ago

Hi The kafkacat command is working ! There was some some issues with API_KEY/API_SECRET. Once i updated the values of these two parameters, the kafkacat command fetched messages from the topic hosted in ccloud.

Regards