We are currently using Kafka version 2.11 and KafakConnect 2.0.0 which is part of the hortonworks distribution we have got. We have enabled Rest API basic authentication by adding this in connect.distributed.properties
listeners=https://${hostname}:${restPort}
and following all the steps mentioned here.
Now everything is working and we are able to use basic auth in all GET and POST operations on the leader node while only GET operations are working on the worker nodes. When we try to do POST operation on worker node we get this Error -
{"error_code":500,"message":"IO Error trying to forward REST request: org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header"}
As per message its quite evident that the worker is trying to forward the POST/DELETE request to Leader and its failing to do so. A sample DELETE request which is failing is like this:
curl -X DELETE -i -H 'Accept:application/json' -H 'Authorization:Basic base64encodedpassword' https://hostname:18084/connectors/someconnector
Please help if someone has faced this issue before. May be something is wrong in formation of my rest request but it works fine when executed on cluster leader... Thanks