diff --git a/library/src/helpers/server.ts b/library/src/helpers/server.ts index eb6bcf9ca..61c2212cd 100644 --- a/library/src/helpers/server.ts +++ b/library/src/helpers/server.ts @@ -53,19 +53,19 @@ export class ServerHelpers { ) { let securityProtocol; let saslMechanism; + if (protocol === 'kafka') { if (securitySchema) { securityProtocol = 'SASL_PLAINTEXT'; } else { securityProtocol = 'PLAINTEXT'; } + } else if (securitySchema) { + securityProtocol = 'SASL_SSL'; } else { - if (securitySchema) { - securityProtocol = 'SASL_SSL'; - } else { - securityProtocol = 'SSL'; - } + securityProtocol = 'SSL'; } + if (securitySchema) { switch (securitySchema.type()) { case 'plain':