1

I have received truststore.jks & keystore.jks file from a team who manages kafka. We are required to build a producer application in .NET using these .jks files. I have used below commands to convert .jks files to required format as .jks is not compatible with .net applications.

keytool -importkeystore -srckeystore truststore.jks -destkeystore truststore.p12 -deststoretype PKCS12

openssl pkcs12 -in truststore.p12 -nokeys -out truststore.cer.pem

keytool -importkeystore -srckeystore keystore.jks -destkeystore keystore.p12 -srcstoretype jks -deststoretype pkcs12

openssl pkcs12 -in keystore.p12 -out keystore.pem

openssl rsa -in keystore.pem -out newrsakeystore.pem

Output of above commands are assinged to producer config properties below:

.net code

After running getting error:

SSL Handshake failed. client SSL Authentication might be required (see ssl.key.location and ssl.certificate.location)

SSL Error

Need help to identify what is wrong here which is making SSL handshake failing.

James Z
  • 12,209
  • 10
  • 24
  • 44
  • Are you sure that filepath is correct? Do you actually have a `/KafkaCerts` folder in the root of your filesystem? – OneCricketeer May 20 '22 at 19:20
  • The issue is resolved. I was doing the right thing but the certificates or .jks files which i was having were expired. So, once i got the correct certificates... boom... its worked. – Dhruv Sanan Jun 06 '22 at 09:23

1 Answers1

1

The issue is resolved. I was doing the right thing but the certificates or .jks files which i was having were expired. So, once i got the correct certificates... boom...SSL Handshake completed and its worked. Use below commands to read the certificate validate and other details:

openssl x509 -in keystore.pem -text