The example does not work with SSL or without SSL.
The problem is the code does not take any property except the bootstrap url and topic.
Hence SSL config does not work.
If you use plaintext then you get error
org.apache.kafka.common.KafkaException: Unexpected error in InitProducerIdResponse; The transaction timeout is larger than the maximum value allowed by the broker (as configured by transaction.max.timeout.ms).\