KAFKA and SSL : java.lang.OutOfMemoryError: Java heap space when using kafka-topics command on KAFKA SSL cluster

I finally found a way to deal with this SSL error. The key is to use the following setting :

--command-config client-ssl.properties

This is working with the most part of KAFKA commands, like kafka-consumer-groups, and of course kafka-topics. See examples below :

kafka-consumer-groups --bootstrap-server <kafka-hostname>:<kafka-port> --group <consumer-group> --topic <topic> --reset-offsets --to-offset <offset> --execute --command-config <ssl-config>

kafka-topics --list --bootstrap-server <kafka-hostname>:<kafka-port> --command-config client-ssl.properties

ssl-config was "client-ssl.properties",see initial post for content. Beware, by using IP address on , you'll have an error if the machine certificate doesnt have alternative name with that IP address. Try to have correct DNS resolution and use FQDN if possible.

Hope this solution will help, cheers!

Blyyyn