We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug using Writer struct with SASL authentication resulted sending the wrong message and made the server terminate the connection
Kafka Version Azure EventHub
To Reproduce Create a writer with SASL and TLS using the struct directly
mechanism := plain.Mechanism{ Username: "xxx", Password: "xxx", } transport := &kafka.Transport{ Dial: (&net.Dialer{ Timeout: 10 * time.Second, DualStack: true, }).DialContext, SASL: mechanism, TLS: &tls.Config{ InsecureSkipVerify: true, }, } w := kafka.Writer{ Addr: kafka.TCP("someurl.windows.net:9093"), Topic: ActivityLogTopic, Balancer: &kafka.LeastBytes{}, ErrorLogger: kafka.LoggerFunc(log.Errorf), Logger: kafka.LoggerFunc(log.Infof), Async: false, Transport: transport, }
Expected behavior Not throwing any error
Additional context I did some debugging and found that SASL handshake was performed before getting all available kafka api version.
I made a PR https://github.com/segmentio/kafka-go/pull/541/files
More specifically, in this code, the order should be reversed (also aligned with the protocol)
kafka-go/transport.go
Lines 1138 to 1158 in cb3dd79
Since the order was reverse, the handshake was done with emtpy c.versions which resulted in wrong api 0 instead of 1
c.versions
0
1
kafka-go/protocol/conn.go
Lines 81 to 91 in cb3dd79
The text was updated successfully, but these errors were encountered:
Thanks for the detailed bug report @yulrizka!
I merged your change and tagged a release for v0.4.6 containing it 👍
Sorry, something went wrong.
achille-roussel
No branches or pull requests
Describe the bug
using Writer struct with SASL authentication resulted sending the wrong message and made the
server terminate the connection
Kafka Version
Azure EventHub
To Reproduce
Create a writer with SASL and TLS using the struct directly
Expected behavior
Not throwing any error
Additional context
I did some debugging and found that SASL handshake was performed before getting all available kafka api version.
I made a PR https://github.com/segmentio/kafka-go/pull/541/files
More specifically, in this code, the order should be reversed (also aligned with the protocol)
kafka-go/transport.go
Lines 1138 to 1158 in cb3dd79
Since the order was reverse, the handshake was done with emtpy
c.versions
which resulted in wrong api0
instead of1
kafka-go/protocol/conn.go
Lines 81 to 91 in cb3dd79
The text was updated successfully, but these errors were encountered: