If the client is c# we have to convert .jks to .pem file and use it in c#. Here you have to convert keystore and trustore to .pem file formats. https://github.com/edenhill/kcat/issues/309
Connect to Kafka with TrustStore KeyStore certificates in .NET
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 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
var cons = new ConsumerConfig
{
GroupId = appSettings.GroupId,
BootstrapServers = appSettings.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"
};
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