The SSH protocol defines disconnect reason codes in section 11.1 of RFC 4253. I have an application where I want to inspect the disconnect reason code. I currently do this by checking the error string, but this is considered a bad practice.
Internally, the x/crypto/ssh package contains a disconnectMsg error type that is the structured form of the disconnect reason data. However, that type is not exposed externally for use with a function such as errors.As. I propose that disconnectMsg (or something like it) be exported so that users may unwrap the error and inspect the reason code.
The text was updated successfully, but these errors were encountered: