Logstash - Kafka input handshake fails

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.

[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:

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