I am trying to connect to a kafka 2.0 server using SSL. I have been provided with a Truststore file and a Keystore file and since I am using python I tried to extract the the client certificate using the command:
keytool -exportcert -alias localhost -keystore kafka.client.keystore.jks -rfc -file certificate.pem
taken from here (a similar command was provided also here). The problem is I am getting an error:
keytool error: java.lang.Exception: Alias does not exist
which I have some trouble decipher. Am I supposed to create an alias myself or I should ask for an alias from the ones provided the JKS containers? I am not really familiar with the SSL configuration so I may be missing something here.
I have also tried to check the available aliases in my machine using the command (from here):
keytool -list -keystore /etc/ssl/certs/java/cacerts -storepass changeit
but I am not sure 1) if this is the right place to search for the aliases and 2) I could not find any relevant entry there I think.
If someone can provide some instructions on how I should proceed from here it would be great.