tomaswolf commented on issue #435: URL: https://github.com/apache/mina-sshd/issues/435#issuecomment-1856496111
Yes, like plain Java HTTP, Apache MINA sshd only uses the first IP address. In part this is hard-coded in Java's `InetSocketAddress(String hostname, int port)`, which resolves the host name using `InetAddress.getByName(hostname)`, which does `return InetAddress.getAllByName(host)[0];`. Apache MINA sshd would need to resolve host names explicitly, and then try all returned addresses explicitly, sequentially with small time-outs or in parallel until one worked. This in itself is not trivial to do, and cancelling such a connection attempt might get tricky, especially if multiple addresses are attempted concurrently. For the Nio2 transport, it would definitely have to be implemented directly in Apache MINA sshd. Perhaps the MINA or Netty transports have something built-in, but at least in Netty's `io.netty.bootstrap.Bootstrap`, which Apache MINA sshd uses to connect, it looks to me as if it also tries only one address. Looks like quite a bit of non-trivial work, and hard to test. But it certainly is a valid feature request. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
