x/crypto: Feature Request: Expose Negotiated Cipher #73679
Labels
LibraryProposal
Issues describing a requested change to the Go standard library or x/ libraries, but not to a tool
Milestone
Feature Request: Expose Negotiated Cipher
What is the issue?
The
golang.org/x/crypto/ssh
package currently does not provide a way via its public API to determine which specific symmetric cipher algorithm was successfully negotiated and is being used for an establishedssh.Conn
(or*ssh.Client
).Why is this needed?
Access to the negotiated cipher string would be valuable for several use cases:
Proposed change:
Add a method to the
ssh.Conn
interface (and its implementations) that returns the names of the negotiated symmetric cipher algorithms used for the client-to-server and server-to-client directions.A possible method signature could be:
Alternatively, this information could potentially be added to a connection statistics or info struct if that is more in line with the library's design philosophy.
Current state:
The negotiated cipher is determined internally by the library during the ssh.Dial or ssh.NewClient handshake based on the client's ssh.ClientConfig.Ciphers list and the server's supported ciphers. However, this specific piece of information is not exposed via any public getter method on the resulting *ssh.Client or ssh.Conn object.
The text was updated successfully, but these errors were encountered: