0
Answer

How to enable SSL certificate in .Net Kafka consumer and producer?

Photo of Alok Gupta

Alok Gupta

1w
195
1

Here are the code, If any iisue , Please fix or help

 var config = new ConsumerConfig
 {
 
     BootstrapServers = "XXX.XX.XXX.XXX:9092", // Your Kafka broker address and SSL port
     SecurityProtocol = SecurityProtocol.Ssl,
     SslCaLocation = @"C:\Prod/KITTING/client.pem",  // Path to your CA certificate
     SslCertificateLocation = @"C:\Prod/KITTING/client-crt.pem", // Path to your client certificate
     SslKeyLocation = @"C:\Prod/KITTING/pkcs8.pem", // Path to your client private key
     GroupId = "my-group",
     AutoOffsetReset = AutoOffsetReset.Earliest // Or other desired offset reset policy

 };

Answers (0)