diff --git a/library/src/helpers/server.ts b/library/src/helpers/server.ts index eb6bcf9ca..c5e9d2f9d 100644 --- a/library/src/helpers/server.ts +++ b/library/src/helpers/server.ts @@ -59,13 +59,12 @@ export class ServerHelpers { } 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':