Skip to content

SaslMechanism uses empty host-config if sasl_kerberos_domain_name is not set #2632

Closed
@SeppMe

Description

@SeppMe

According to the manual, sasl_kerberos_domain_name should default to one of the bootstrap servers, if not set. However, this does not currently work. The lines

kerberos_domain_name = config.get('sasl_kerberos_domain_name', '') or config.get('host', '')

in the respective __init__ methods of the various SaslMechanisms try to access config['host'], which is never set in the BrokerConnection object. Thus, the get defaults to an empty string, which is effectively the local host when a connection is attempted down the line. Which in general is wrong and fails. The SaslMechanismAwsMskIam should not even work at all, as it makes an assertion that host is in the config, but I cannot test that right now, because my environment is not set up for it.

I think, a simple self.config['host'] = host in the BrokerConnection's __init__ before self._init_sasl_mechanism() should do. As far as I can tell, config['host'] gets used nowhere else, so there should not be unexpected side-effects. I am preparing a pull request for this + tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions