What is SaslHandshake?
Negotiates the SASL authentication mechanism immediately after TCP connection, before any data flows. If the client requests a mechanism the broker doesn't support (e.g., SCRAM-SHA-512 when only PLAIN is configured), the broker responds with the supported list and closes the connection.
Wire Diagram
Response Header
message_size
int32 · 4B
correlation_id
int32 · 4B
SaslHandshakeResponse v0
ErrorCode
int16 · 2B
Mechanisms
[]string
Schema & Example
Schema { "ErrorCode": int16, "Mechanisms": [string] }
Example { "ErrorCode": 0, "Mechanisms": ["PLAIN", "SCRAM-SHA-256"] }