x/crypto/ssh: Additional information from HostKeyCallback or Handshake failure #16459
Please answer these questions before submitting your issue. Thanks!
So currently in the error I return from my HostKeyCallback I set additional information I'd like to retrieve later when making a client connection. Currently this is difficult because the error is always wrapped by fmt.Errorf at the line above. I know I can set additional state in my function (maybe a map with a mutex) or run a regex against the returned error to see if it contains my error, but neither of those seemed very good.
My idea is to add a simple HandshakeError type that saves a reference to the original error and is returned in the client handshake (maybe the sever handshake too). Something like this
The text was updated successfully, but these errors were encountered: