title: Getting SSL handshake error while Enabling SSL in KAFKA
body: <p>I’m getting SSL handshake failed when I start producer to push data, did below settings:</p>
  
  <pre><code>1. Followed steps as per 
      https://docs.confluent.io/2.0.0/kafka/ssl.html to create keystore
  2.  Started zookeeper with default settings
  3.  Made below changes in kafka server properties:
      a.  listeners=SSL://hostName:9092
      b.  ssl.keystore.location =/home/kafka_2.12- 
         2.2.0/kafka.server.keystore.jks
      c.  ssl.keystore.password =keystore
      d.  ssl.key.password =keystore
      e.  ssl.truststore.location =/home/kafka_2.12- 
         2.2.0/kafka.server.truststore.jks
      f.  ssl.truststore.password =keystore
      g.  ssl.endpoint.identification.algorithm=HTTPS
      h.  advertised.listeners=SSL://hostName:9092
      i.  inter.broker.listener.name=SSL
      j.  listener.security.protocol.map=SSL:SSL
  </code></pre>
  
  <p>After doing above steps, I was able to start kafka server and server got started.</p>
  
  <pre><code>Command bin/zookeeper-shell.sh localhost:2181 &lt;&lt;&lt; "get /brokers/ids/0" gave below output that means broker id 0 was up and listening  on 
  SSL://hostName:9092
  Connecting to localhost:2181
  Welcome to ZooKeeper!
  JLine support is disabled
  WATCHER::
  WatchedEvent state:SyncConnected type:None path:null
  {"listener_security_protocol_map":{"SSL":"SSL"},"endpoints": 
  ["SSL://hostName:9092"]
   ,"jmx_port":-1,"host":null,"timestamp":"1559106754150" 
   ,"port":-1,"version":4}
  cZxid = 0x425
  ctime = Wed May 29 10:42:34 IST 2019
  mZxid = 0x425
  mtime = Wed May 29 10:42:34 IST 2019
  pZxid = 0x425
  cversion = 0
  dataVersion = 1
  aclVersion = 0
  ephemeralOwner = 0x1004d6fe052000a
  dataLength = 159
  numChildren = 0
  </code></pre>
  
  <p>But when I’m starting kafka producer to push data, I’m getting SSL handshake error on kafka server console</p>
  
  <p>To start producer
      bin/kafka-console-producer.sh --broker-list hostName:9092 --topic test3</p>
  
  <pre><code>[2019-05-29 10:45:57,808] INFO [SocketServer brokerId=0] Failed 
  authentication with /101.101.101.101 (SSL handshake failed) 
  (org.apache.kafka.common.network.Selector)
  [2019-05-29 10:45:58,143] INFO [SocketServer brokerId=0] Failed 
  authentication with /101.101.101.101 (SSL handshake failed) 
  (org.apache.kafka.common.network.Selector)
  [2019-05-29 10:45:58,728] INFO [SocketServer brokerId=0] Failed 
  authentication with /101.101.101.101 (SSL handshake failed) 
  (org.apache.kafka.common.network.Selector)
  [2019-05-29 10:45:59,613] INFO [SocketServer brokerId=0] Failed 
  authentication with /101.101.101.101 (SSL handshake failed) 
  (org.apache.kafka.common.network.Selector)
  [2019-05-29 10:46:00,600] INFO [SocketServer brokerId=0] Failed 
  authentication with /101.101.101.101 (SSL handshake failed) 
  (org.apache.kafka.common.network.Selector)
  [2019-05-29 10:46:01,688] INFO [SocketServer brokerId=0] Failed 
  authentication with /101.101.101.101 (SSL handshake failed) 
  (org.apache.kafka.common.network.Selector)
  [2019-05-29 10:46:02,928] INFO [SocketServer brokerId=0] Failed 
  authentication with /101.101.101.101 (SSL handshake failed) 
  (org.apache.kafka.common.network.Selector)
  </code></pre>
  
  <p>Note: Kafka broker server and producer are on same host</p>
  
  <p>Expecting Producer should push data to broker which is running on same localhost.
  Consumer from another node should be able to consume.
  Data should be encrypted as we are enabling SSL</p>