Kafka SSL connection error

Viewed 7436

I am getting the warning below while doing produce from client side which is connecting to server side which contains SSL based authentication:

[2016-03-10 07:09:13,018] WARN The configuration ssl.keystore.location = /etc/pki/tls/certs/keystore-hpfs.jks was supplied but isn't a known config. (org.apache.kafka.clients.producer.ProducerConfig)
[2016-03-10 07:09:13,019] WARN The configuration ssl.keystore.password = 1qazxsw2 was supplied but isn't a known config. (org.apache.kafka.clients.producer.ProducerConfig)
[2016-03-10 07:09:13,019] WARN The configuration ssl.key.password = 1qazxsw2 was supplied but isn't a known config. (org.apache.kafka.clients.producer.ProducerConfig)
[2016-03-10 07:09:13,019] WARN The configuration ssl.truststore.type = JKS was supplied but isn't a known config. (org.apache.kafka.clients.producer.ProducerConfig)
[2016-03-10 07:09:13,019] WARN The configuration ecurity.protocol = SSL was supplied but isn't a known config. (org.apache.kafka.clients.producer.ProducerConfig)
[2016-03-10 07:09:13,019] WARN The configuration ssl.keystore.type = JKS was supplied but isn't a known config. (org.apache.kafka.clients.producer.ProducerConfig)
[2016-03-10 07:09:13,019] WARN The configuration ssl.enabled.protocols = TLSv1.2,TLSv1.1,TLSv1 was supplied but isn't a known config. (org.apache.kafka.clients.producer.ProducerConfig)

So I am not able to produce any message getting below error:

ERROR Error when sending message to topic test with key: null, value: 2 bytes with error: Failed to update metadata after 60000 ms. (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)

2 Answers

I had this very same issue for the producer while kafka logged SSL Handshake error. Turned out I forgot to add security.protocol=SSL to my producer properties.

in your server.properties, ssl.keystore.type and ssl.truststore.type are optional properties, I can see ssl.truststore.location is missing in you configs, make sure you add them.

listeners=PLAINTEXT://host.name:port,SSL://host.name:port

make sure you use the port you gave for SSL connection.

ssl.client.auth=required //for two way SSL

Disable the host name validation by setting:

ssl.endpoint.identification.algorithm=
Related