diff --git a/sshd-common/src/main/java/org/apache/sshd/common/util/net/SshdSocketAddress.java b/sshd-common/src/main/java/org/apache/sshd/common/util/net/SshdSocketAddress.java index 2bbbd3677..9f51a7622 100644 --- a/sshd-common/src/main/java/org/apache/sshd/common/util/net/SshdSocketAddress.java +++ b/sshd-common/src/main/java/org/apache/sshd/common/util/net/SshdSocketAddress.java @@ -399,7 +399,7 @@ public static SshdSocketAddress toSshdSocketAddress(SocketAddress addr) { return (SshdSocketAddress) addr; } else if (addr instanceof InetSocketAddress) { InetSocketAddress isockAddress = (InetSocketAddress) addr; - return new SshdSocketAddress(isockAddress.getHostName(), isockAddress.getPort()); + return new SshdSocketAddress(isockAddress.getHostString(), isockAddress.getPort()); } else { throw new UnsupportedOperationException("Cannot convert " + addr.getClass().getSimpleName() + "=" + addr + " to " + SshdSocketAddress.class.getSimpleName());