Hello,
I have to connect to some kafka instances, i was able to connect with this instances in plaintext one month ago, now i have to use authorization. I have two file, a keystore.jks and truststore.jks and related passwords, provided me by devops, i suppose when i create class ConsumerConfig i have to pass parameters related to authentication , but despite my efforts i cant authenticate with kafka.
i have tried in similar fashion:
var cons = new ConsumerConfig
{
GroupId = "GroupId",
BootstrapServers = "BootstrapServers",
Acks = Acks.All,
AutoOffsetReset = AutoOffsetReset.Earliest,
Debug = "debug,channel",
EnableAutoCommit = false,
SecurityProtocol = SecurityProtocol.Ssl,
SaslMechanism = SaslMechanism.ScramSha256,
SslKeystoreLocation = @"C:\dev.keystore.jks",
SslKeystorePassword = "keystorepassword",
SslCaLocation = @"C:\dev.keystore.jks",
SslCertificateLocation = @"C:\kafkadev.truststore.jks",
SslKeyPassword = "truststorepassword"
};
i receive:
Disconnected while requesting ApiVersion: might be caused by incorrect security.protocol configuration (connecting to a SSL listener?)
Some other teammates that works in java was able to connect using these two file.
Can someone help me?
Thanks