{"id":10812,"date":"2024-03-27T16:13:35","date_gmt":"2024-03-27T21:13:35","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=10812"},"modified":"2024-03-27T16:13:36","modified_gmt":"2024-03-27T21:13:36","slug":"communicating-with-kafka-server-using-ssl","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=10812","title":{"rendered":"Communicating With Kafka Server Using SSL"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Update the Client Configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use the keytool command to create a trust store with the CA chain used in your certificates. I am using Venafi, so I need to import two CA public keys:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nkeytool -keystore kafka.truststore.jks -alias SectigoRoot -import -file &quot;Sectigo RSA Organization Validation Secure Server CA.crt&quot;\nkeytool -keystore kafka.truststore.jks -alias UserTrustRoot -import -file &quot;USERTrust RSA Certification Authority.crt&quot;\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"SSLForNPMKafka-UpdatetheClientConfiguration\">Update the Client Configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create a producer-ssl.properties or consumer-ssl.properties based on your current producer\/consumer properties file. Update the port \u2013 9095 is used for SSL\u00a0\u2013 and append the following lines<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsecurity.protocol=SSLssl.truststore.location=\/path\/to\/kafka.truststore.jks\nssl.truststore.password=&lt;WhateverYouSetInThePreviousStep&gt;\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"SSLForNPMKafka-UsingtheCLIClientTools\">Using the CLI Client Tools<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have a property configured properties file, you can invoke either the kafka-console-consumer.sh or kafka-console-producer.sh scripts indicating your new properties file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\/kafka\/bin\/kafka-console-consumer.sh --bootstrap-server kafka1586.example.net:9095 --topic LJRTest --consumer.config \/kafka\/config\/consumer-ssl.properties --group LJR5\n\n\/kafka\/bin\/kafka-console-producer.sh --bootstrap-server kafka1586.example.net:9095 --topic LJRTest --producer.config \/kafka\/config\/producer-ssl.properties\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">To debug SSL communication, set the following KAFKA_OPTS prior to invoking the command line producer\/consumer utilities:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nexport KAFKA_OPTS=&quot;-Djavax.net.debug=ssl,handshake&quot;\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Update the Client Configuration Use the keytool command to create a trust store with the CA chain used in your certificates. I am using Venafi, so I need to import two CA public keys: Update the Client Configuration Create a producer-ssl.properties or consumer-ssl.properties based on your current producer\/consumer properties file. Update the port \u2013 9095 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1762],"tags":[1361],"class_list":["post-10812","post","type-post","status-publish","format-standard","hentry","category-kafka","tag-kafka"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10812"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10812\/revisions"}],"predecessor-version":[{"id":10813,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10812\/revisions\/10813"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}