tomaswolf opened a new issue, #728: URL: https://github.com/apache/mina-sshd/issues/728
### Description The `HostConfigEntry` used in `SshClient` should be forwarded to the to-be-created `ClientSession`. This can be done via the "connectionContext" `AttributeRepository`. This one gets passed from the `SshClient` to the `IoConnector`, and gets attached to the `IoSession` that is created. The `AbstractClientSession` already extracts it from the `IoSession` and makes it available via `getConnectionContext()`. So the `SshClient` just has to add the `HostConfigEntry` as an attribute there, and the `AbstractClientSession` can then retrieve that attribute and make it available via a new `getHostConfigEntry()` convenience method. ### Motivation A client session needs to know the `HostConfigEntry`, and it needs to know it before it is started. The host entry might contain configurations relevant already for the initial key exchange, such as cipher, mac, or host key signature algorithm settings. Propagating such information only after the SSH session has been created and started is too late. ### Alternatives considered Setting properties from the host entry somewhere where the to-be-created session can find them. But where? Such properties cannot be set on the session itself since it doesn't exist yet. Setting them on the client won't work because the settings are specific to the new session, but a client can created many sessions. We'd risk using the wrong settings for the wrong sessions. This extra "connection context" `AttributeRepository` appears to be the right place, provided the `SshClient` can make sure it gives each session its own such attribute repository (which _is_ possible). ### Additional context JGit has implemented that years ago in their SSH transport. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org