From 9d563648b759b71b404567cfdf6d271ddc8fa6b4 Mon Sep 17 00:00:00 2001 From: Looly Date: Wed, 18 May 2022 10:24:00 +0800 Subject: [PATCH] fix bug --- CHANGELOG.md | 3 ++- hutool-extra/src/main/java/cn/hutool/extra/ssh/SshjSftp.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4452585d..230c2ddc5 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,11 @@ ------------------------------------------------------------------------------------------------------------- -# 5.8.2.M1 (2022-05-16) +# 5.8.2.M1 (2022-05-18) ### 🐣新特性 ### 🐞Bug修复 +* 【extra 】 修复SshjSftp初始化未能代入端口配置问题(issue#2333@Github) ------------------------------------------------------------------------------------------------------------- diff --git a/hutool-extra/src/main/java/cn/hutool/extra/ssh/SshjSftp.java b/hutool-extra/src/main/java/cn/hutool/extra/ssh/SshjSftp.java index d458420c1..7e59d9077 100644 --- a/hutool-extra/src/main/java/cn/hutool/extra/ssh/SshjSftp.java +++ b/hutool-extra/src/main/java/cn/hutool/extra/ssh/SshjSftp.java @@ -102,7 +102,7 @@ public class SshjSftp extends AbstractFtp { this.ssh = new SSHClient(); ssh.addHostKeyVerifier(new PromiscuousVerifier()); try { - ssh.connect(ftpConfig.getHost()); + ssh.connect(ftpConfig.getHost(), ftpConfig.getPort()); ssh.authPassword(ftpConfig.getUser(), ftpConfig.getPassword()); ssh.setRemoteCharset(ftpConfig.getCharset()); this.sftp = ssh.newSFTPClient();