cmdReporter Wiki

Kafka and Self-signed Server Certificates

Kafka and Self-signed Server Certificates

If your test environment kafka servers use self-signed certificates extra steps are required to generate the certificate for cmdReporter's TLSServerCertificate preference.

Due to certificate validation requirements the certificate authority must be combined with the signed server certificate in the TLSServerCertificate preference. Conversion steps are below, starting with an operational self-signed kafka server key and trust store.


# Make a copy of the truststore in p12 format, can't go directly to .pem format
1) /usr/bin/keytool -importkeystore -srckeystore kafka-server.truststore.jks -destkeystore kafka-server-truststore-copy.p12 -srcstoretype jks -deststoretype pkcs12

# Convert new .p12 into the .pem format we need
2) /usr/bin/openssl pkcs12 -in kafka-server-truststore-copy.p12 -out kafka-server-truststore-copy.pem

# Concatenate the certificate authority .pem and the self-signed server public certificate
3) /bin/cat "kafka-server-truststore-copy.pem" "kafka-server-public-cert" > copy_everything_in_here_to_TLSServerCertificate_pref.txt

4) /bin/cat "copy_everything_in_here_to_TLSServerCertificate_pref.txt"
-----BEGIN CERTIFICATE-----
MIID3DCCAsQCCQC+fcrOm+zE4DANBgkqhkiG9w0BAQsFADCBrzELMAkGA1UEBhMC
VVMxDTALBgNVBAgMBE5vbmUxDzANBgNVBAcMBlNlY3JldDEUMBIGA1UECgwLY21k
U2VjdXJpdHkxGjAYBgNVBAsMEU1hZ2ljYWwgTXlzdGVyaWVzMS8wLQYDVQQDDCZl
bWFpbC5kYW4uYWJvdXQuam9iLmF0LmNtZHNlY3VyaXR5LmNvbTEdMBsGCSqGSIb3
DQEJARYOZGFuQGNtZHNlYy5jb20wHhcNMTkwNTE1MDUzMTM1WhcNMjkwNTEyMDUz
MTM1WjCBrzELMAkGA1UEBhMCVVMxDTALBgNVBAgMBE5vbmUxDzANBgNVBAcMBlNl
Y3JldDEUMBIGA1UECgwLY21kU2VjdXJpdHkxGjAYBgNVBAsMEU1hZ2ljYWwgTXlz
dGVyaWVzMS8wLQYDVQQDDCZlbWFpbC5kYW4uYWJvdXQuam9iLmF0LmNtZHNlY3Vy
aXR5LmNvbTEdMBsGCSqGS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be helpful. Help us improve this article with your feedback.