confluentinc / cp-docker-images

[DEPRECATED] Docker images for Confluent Platform.
Apache License 2.0
1.14k stars 705 forks source link

SSL Kafka handshake failed over docker #914

Open laurafbec opened 2 years ago

laurafbec commented 2 years ago

Hi everyone, Based on the example https://github.com/confluentinc/cp-docker-images/tree/5.3.3-post/examples/kafka-cluster-ssl I've tried to develop a docker-compose file with zookeeper, a broker and the connect API with SSL enabled. The certificates have been generated by using the script included in the example and the content of the docker-compose file would be the next one:

`version: '3.6'

services: zookeeper: image: confluentinc/cp-zookeeper:7.0.1 hostname: zookeeper container_name: zookeeper ports:

When running it I get the error from broker

[2022-01-10 11:08:03,163] INFO [SocketServer listenerType=ZK_BROKER, nodeId=1] Failed authentication with /172.19.0.4 (SSL handshake failed) (org.apache.kafka.common.network.Selector)

Can anyone help me? thanks in advance

OneCricketeer commented 2 years ago

The error is suggesting you didn't setup SSL for Zookeeper. And your environment variables for Zookeeper seem to confirm that

The examples have moved, by the way https://github.com/confluentinc/kafka-images/blob/master/examples/kafka-cluster-ssl/docker-compose.yml

laurafbec commented 2 years ago

Thanks @OneCricketeer !! I've actually solved it after posting the error. I had a mismatch between kafka listeners and the certs, and now I've TLSv1.3 enabled between kafka client and broker. I haven't found examples about enabling TLS for Zokeeper of Kafka connect. Do you know where can I find some of them? Thanks again!

OneCricketeer commented 2 years ago

haven't found examples about enabling TLS for Zookeeper or Kafka connect.

Is this page what you're looking for?

https://docs.confluent.io/platform/current/security/security_tutorial.html

Otherwise, Zookeeper has its own official documentation, and Connect is configured like any other broker client. Both utilize KAFKA_JAVA_OPTS environment variables for setting JAAS or other JVM System properties

Connect doesn't depend on Zookeeper

laurafbec commented 2 years ago

Thanks again @OneCricketeer!! I actually was looking for docker-compose examples with SSL enabled between zookeeper and Kafka. On that page is described SASL for Zookeeper, but, I think that SSL is not. But thanks anyway!! I'll check everything.