confluentinc / confluent-kafka-dotnet

Confluent's Apache Kafka .NET client
https://github.com/confluentinc/confluent-kafka-dotnet/wiki
Apache License 2.0
68 stars 861 forks source link

SSL auth doesn't work on Windows #1989

Open root691 opened 1 year ago

root691 commented 1 year ago

Description

Hi! I have Kafka with two way SSL. Faced strange behavior on Windows.

Firstly, it looks like the SslCaLocation parameter does not work correctly on Windows. The library always tries to take the CA certificate to check the broker from the Windows certificate store. Even if the path to a specific file is set in SslCaLocation.

But the problem with SslCaLocation at least has a workaround - add the CA to the store. I ran into a problem that the client certificate for authentication does not work at all under Windows. At the same time, the same code works perfectly fine under Linux. From Windows Kafka broker always raise error Empty client certificate chain.

And yes, I am fully confident in the correctness of the certificates. I am running the same code with the same certs from Windows and Linux.

Can you please help with that? I've searched half the Internet but couldn't find any solution to the problem or a clue that I'm doing something wrong.

How to reproduce

I made a small repository where it is described step by step how to reproduce the problem. With running Kafka locally in docker and checking behavior under Windows and Linux. The only thing you need is WSL. https://github.com/root691/kafka-ssl-test

Checklist

x-strong commented 1 year ago

I met the same problem using Clenfluent.Kafka v2.0.2 SDK but it is OK using v.1.9.3.