Skip to content

Commit 2fc66e4

Browse files
authored
Fix sasl authentication on writer (#541)
The authenticateSASL was called before getting api version. This resulted incorrect apiversion (0 instead of 1) when calling saslHandshakeRoundTrip request
1 parent cb3dd79 commit 2fc66e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

transport.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -1135,12 +1135,6 @@ func (g *connGroup) connect(ctx context.Context, addr net.Addr) (*conn, error) {
11351135
pc := protocol.NewConn(netConn, g.pool.clientID)
11361136
pc.SetDeadline(deadline)
11371137

1138-
if g.pool.sasl != nil {
1139-
if err := authenticateSASL(ctx, pc, g.pool.sasl); err != nil {
1140-
return nil, err
1141-
}
1142-
}
1143-
11441138
r, err := pc.RoundTrip(new(apiversions.Request))
11451139
if err != nil {
11461140
return nil, err
@@ -1160,6 +1154,12 @@ func (g *connGroup) connect(ctx context.Context, addr net.Addr) (*conn, error) {
11601154
pc.SetVersions(ver)
11611155
pc.SetDeadline(time.Time{})
11621156

1157+
if g.pool.sasl != nil {
1158+
if err := authenticateSASL(ctx, pc, g.pool.sasl); err != nil {
1159+
return nil, err
1160+
}
1161+
}
1162+
11631163
reqs := make(chan connRequest)
11641164
c := &conn{
11651165
network: netAddr.Network(),

0 commit comments

Comments
 (0)