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