# Logstash - Kafka input handshake fails

**URL:** <https://discuss.elastic.co/t/logstash-kafka-input-handshake-fails/357154>\
**Category:** Logstash\
**Created:** [April 10, 2024, 1:55pm UTC](https://discuss.elastic.co/t/logstash-kafka-input-handshake-fails/357154 "2024-04-10T13:55:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thibaut\_a](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@thibaut\_a](https://discuss.elastic.co/u/thibaut_a)\
**Post date:** [April 10, 2024, 1:55pm UTC](https://discuss.elastic.co/t/logstash-kafka-input-handshake-fails/357154/1 "2024-04-10T13:55:01Z")

</div>

Hi,

I try to configure a Kafka input in Logstash, but the handshake fails and I don't have a lot of logs to find a solution.

```auto
[2024-04-10T13:40:11,511][ERROR][logstash.inputs.kafka][main][kafka] Unable to poll Kafka consumer {:kafka_error_message=>#<Java::OrgApacheKafkaCommonErrors::SslAuthenticationException: SSL handshake failed>, :cause=>#<Java::JavaxNetSsl::SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target>}

```

I can read topics if I disable SSL but as I must use it at work, I must add security in the configuration.

Here is my 'logstash.conf' input:

```auto
kafka {
		id => "kafka"
		bootstrap_servers => "server:port"
		topics_pattern => "^test$"
		auto_offset_reset => "earliest"
		security_protocol => "SSL"
		ssl_keystore_type => "jks"
		ssl_keystore_location => "/usr/share/logstash/jks/tabcom.jks"
		ssl_keystore_password => "password"
		ssl_endpoint_identification_algorithm => ""
	}

```

I also tried with "ssl\_truststore" variables, and with both of them.

Does someone know how can I solve this problem?

Thank you
