# Configuring logstash with ssl and sending message to kafka(with ssl) topic

**URL:** <https://discuss.elastic.co/t/configuring-logstash-with-ssl-and-sending-message-to-kafka-with-ssl-topic/186805>\
**Category:** Logstash\
**Created:** [June 21, 2019, 6:51am UTC](https://discuss.elastic.co/t/configuring-logstash-with-ssl-and-sending-message-to-kafka-with-ssl-topic/186805 "2019-06-21T06:51:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rchillal](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@rchillal](https://discuss.elastic.co/u/rchillal)\
**Post date:** [June 21, 2019, 6:51am UTC](https://discuss.elastic.co/t/configuring-logstash-with-ssl-and-sending-message-to-kafka-with-ssl-topic/186805/1 "2019-06-21T06:51:24Z")

</div>

I have **logstash-6.5.4 (with ssl) in my local (hostname: webbox)** and **kafka-2.0 (with ssl) on another (hostname: kafkabox)**.

I am not able to receive message in kafka topic when message is sent from logstash.

Neither error message is displayed not message is sent to kafka topic. I tried to import logstash.crt into kafka's truststore but it also didn't worked.

Created logstash.crt and logstash.key with below command.

```auto
sudo openssl req -x509 -batch -nodes -days 3650 -newkey rsa:2048 -keyout /etc/logstash/logstash.key -out /etc/logstash/logstash.crt

```

Imported the logstash.crt into kafka's truststore file also and tried.

```auto
keytool -import -alias logstash -file logstash.crt -keystore cacerts

```

Logstash conf file is given below...

```auto
input {
    tcp {
    host=>"0.0.0.0" 
    port=>5514 
    type=>"syslogType"
    ssl_enable=>true
    ssl_cert=>"/etc/logstash/logstash.crt"
    ssl_key=>"/etc/logstash/logstash.key"
    ssl_verify=>false
    }
}

filter {
}

output {
    kafka {
    bootstrap_servers=>"kafkabox:9093"
    codec=>"json_lines"
    topic_id=>"a_test"
    ssl_keystore_location=>"keystore file"
    ssl_keystore_password=>"changeit"
    ssl_key_password=>"changeit"
    ssl_truststore_location=>"truststore file"
    ssl_truststore_password=>"changeit"
    security_protocol=>"SSL"
    }
}

```

Expecting message is sent from logstash (with SSL) to kafka (with SSL).

Thanks, RK,

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 19, 2019, 6:51am UTC](https://discuss.elastic.co/t/configuring-logstash-with-ssl-and-sending-message-to-kafka-with-ssl-topic/186805/2 "2019-07-19T06:51:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
