Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! 👋
in #615 we added authentication with SASL and shortly after the release I noticed that we did take care of the authentication but forgot about SSL in the process. As a result SASL authentication currently does only work if the connection to the broker is not encrypted (SASL PLAIN). This is because Tile38 does not allow for the verification to be skipped in the sarama config.
I created an example for the case at iwpnd/tile-kafka-sasl and tested SASL auth without SSL successfully.
Now with this PR I want to fix this introducing a new auth flow to support TLS, SASL, SASL/SSL and no-auth as follows:
SASL PLAIN
?auth=sasl&sha512=true
is using using credentials from the envKAFKA_PASSWORD
/KAFKA_USERNAME
SASL/SSL
?auth=sasl&ssl=true&sha512=true&cacert=/path/to/cert
is is using using credentials from the envKAFKA_PASSWORD
/KAFKA_USERNAME
. This now also validates the given root certificate accordingly.TLS
?auth=tls&cacert=/path/to/cacert&cert=/path/to/user.crt&key=/path/to/user.key
works as it had before #615. As TLS authenfication requires SSL, the additionalssl=true
is obsolete and will be ignored.Additional authentication methods can now be added as they're needed (SASL GSSAPI, PLAIN).
SASL/SSL has now been tested in a production environment with this fork iwpnd/ben38 successfully.
What do you think?