Skip to content

Conversation

@whit0694
Copy link

@whit0694 whit0694 commented Sep 6, 2024

The current approach adds SSL configuration if the advertised listeners includes the string SSL://.

But in a configuration such as

KAFKA_ADVERTISED_LISTENERS: CLIENTS://mykafka.host:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CLIENTS:SSL

The ssl configuration is not added, even though the protocol CLIENTS does map to SSL

Tweaking this configuration script so that it looks in both KAFKA_ADVERTISED_LISTENERS and KAFKA_LISTENER_SECURITY_PROTOCOL_MAP for usage of SSL.

The current approach adds SSL configuration if the advertised listeners
includes the string `SSL://`.

But in a configuration such as

```
KAFKA_ADVERTISED_LISTENERS: CLIENTS://mykafka.host:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CLIENTS:SSL
```

The ssl configuration is not added, even though the protocol `CLIENTS`
does map to `SSL`

Tweaking this configuration script so that it looks in both
`KAFKA_ADVERTISED_LISTENERS` and `KAFKA_LISTENER_SECURITY_PROTOCOL_MAP`
for usage of SSL.
@whit0694 whit0694 requested a review from a team as a code owner September 6, 2024 20:08
@cla-assistant
Copy link

cla-assistant bot commented Sep 6, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@soondenana soondenana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for the fix.

# Set if ADVERTISED_LISTENERS has SSL:// or SASL_SSL:// endpoints.
if [[ -n "${KAFKA_ADVERTISED_LISTENERS-}" ]] && [[ $KAFKA_ADVERTISED_LISTENERS == *"SSL://"* ]]
# Or if the LISTENER_SECURITY_PROTOCOL_MAP includes SSL
if ([[ -n "${KAFKA_ADVERTISED_LISTENERS-}" ]] && [[ $KAFKA_ADVERTISED_LISTENERS == *"SSL://"* ]]) ||
Copy link
Member

@trnguyencflt trnguyencflt Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work with lower case, for example Sasl_ssl

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Is that something that people would do? I don't think the current code covers that case either.

@lundefugl
Copy link

lundefugl commented Apr 28, 2025

What's next? We're waiting for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants