diff --git a/endpoints/citrus-ftp/src/main/java/com/consol/citrus/ftp/client/ScpClient.java b/endpoints/citrus-ftp/src/main/java/com/consol/citrus/ftp/client/ScpClient.java index 32c5194e60..3223900556 100644 --- a/endpoints/citrus-ftp/src/main/java/com/consol/citrus/ftp/client/ScpClient.java +++ b/endpoints/citrus-ftp/src/main/java/com/consol/citrus/ftp/client/ScpClient.java @@ -33,10 +33,10 @@ import org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier; import org.apache.sshd.client.keyverifier.KnownHostsServerKeyVerifier; import org.apache.sshd.client.keyverifier.RejectAllServerKeyVerifier; -import org.apache.sshd.client.scp.DefaultScpClientCreator; import org.apache.sshd.client.session.ClientSession; import org.apache.sshd.common.keyprovider.ClassLoadableResourceKeyPairProvider; import org.apache.sshd.common.keyprovider.FileKeyPairProvider; +import org.apache.sshd.scp.client.DefaultScpClientCreator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.ClassPathResource; @@ -49,9 +49,9 @@ public class ScpClient extends SftpClient { /** Logger */ - private static Logger log = LoggerFactory.getLogger(ScpClient.class); + private static final Logger LOG = LoggerFactory.getLogger(ScpClient.class); - private org.apache.sshd.client.scp.ScpClient scpClient; + private org.apache.sshd.scp.client.ScpClient scpClient; /** * Default constructor initializing endpoint configuration. @@ -93,7 +93,7 @@ protected FtpMessage storeFile(PutCommand command, TestContext context) { try { scpClient.upload(FileUtils.getFileResource(command.getFile().getPath(), context).getFile().getAbsolutePath(), command.getTarget().getPath()); } catch (IOException e) { - log.error("Failed to store file via SCP", e); + LOG.error("Failed to store file via SCP", e); return FtpMessage.error(); } @@ -105,12 +105,12 @@ protected FtpMessage retrieveFile(GetCommand command, TestContext context) { try { Resource target = FileUtils.getFileResource(command.getTarget().getPath(), context); if (!Optional.ofNullable(target.getFile().getParentFile()).map(File::mkdirs).orElse(true)) { - log.warn("Failed to create target directories in path: " + target.getFile().getAbsolutePath()); + LOG.warn("Failed to create target directories in path: " + target.getFile().getAbsolutePath()); } scpClient.download(command.getFile().getPath(), target.getFile().getAbsolutePath()); } catch (IOException e) { - log.error("Failed to retrieve file via SCP", e); + LOG.error("Failed to retrieve file via SCP", e); return FtpMessage.error(); } diff --git a/endpoints/citrus-ftp/src/main/java/com/consol/citrus/ftp/server/SftpServer.java b/endpoints/citrus-ftp/src/main/java/com/consol/citrus/ftp/server/SftpServer.java index c77dbc50ce..2079292495 100644 --- a/endpoints/citrus-ftp/src/main/java/com/consol/citrus/ftp/server/SftpServer.java +++ b/endpoints/citrus-ftp/src/main/java/com/consol/citrus/ftp/server/SftpServer.java @@ -32,11 +32,11 @@ import com.consol.citrus.xml.StringResult; import org.apache.commons.net.ftp.FTPCmd; import org.apache.ftpserver.ftplet.DataType; -import org.apache.sshd.common.scp.ScpTransferEventListener; import org.apache.sshd.common.session.Session; +import org.apache.sshd.scp.common.ScpTransferEventListener; import org.apache.sshd.server.session.ServerSession; -import org.apache.sshd.server.subsystem.sftp.FileHandle; -import org.apache.sshd.server.subsystem.sftp.SftpEventListener; +import org.apache.sshd.sftp.server.FileHandle; +import org.apache.sshd.sftp.server.SftpEventListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,7 +47,7 @@ public class SftpServer extends SshServer implements ScpTransferEventListener, SftpEventListener { /** Logger */ - private static Logger log = LoggerFactory.getLogger(SftpServer.class); + private static final Logger LOG = LoggerFactory.getLogger(SftpServer.class); /** This servers endpoint configuration */ private final SftpEndpointConfiguration endpointConfiguration; @@ -74,8 +74,8 @@ public FtpMessage handleMessage(FtpMessage request) { request.setPayload(result.toString()); } - if (log.isDebugEnabled()) { - log.debug(String.format("Received request on ftp server: '%s':%n%s", + if (LOG.isDebugEnabled()) { + LOG.debug(String.format("Received request on ftp server: '%s':%n%s", request.getSignal(), request.getPayload(String.class))); } @@ -113,8 +113,8 @@ public void startFolderEvent(Session session, FileOperation op, Path file, Set

availableSignatureFactories = sshd.getSignatureFactoriesNames(); + availableSignatureFactories.add("ssh-dss"); + sshd.setSignatureFactoriesNames(availableSignatureFactories); + sshd.start(); return sshd; diff --git a/endpoints/citrus-ssh/src/main/java/com/consol/citrus/ssh/server/SshServer.java b/endpoints/citrus-ssh/src/main/java/com/consol/citrus/ssh/server/SshServer.java index 3aeed6ac76..2385c62fd5 100644 --- a/endpoints/citrus-ssh/src/main/java/com/consol/citrus/ssh/server/SshServer.java +++ b/endpoints/citrus-ssh/src/main/java/com/consol/citrus/ssh/server/SshServer.java @@ -36,13 +36,13 @@ import org.apache.sshd.common.file.virtualfs.VirtualFileSystemFactory; import org.apache.sshd.common.keyprovider.ClassLoadableResourceKeyPairProvider; import org.apache.sshd.common.keyprovider.FileKeyPairProvider; -import org.apache.sshd.common.scp.AbstractScpTransferEventListenerAdapter; -import org.apache.sshd.common.scp.ScpTransferEventListener; -import org.apache.sshd.server.scp.ScpCommandFactory; +import org.apache.sshd.scp.common.AbstractScpTransferEventListenerAdapter; +import org.apache.sshd.scp.common.ScpTransferEventListener; +import org.apache.sshd.scp.server.ScpCommandFactory; import org.apache.sshd.server.subsystem.SubsystemFactory; -import org.apache.sshd.server.subsystem.sftp.AbstractSftpEventListenerAdapter; -import org.apache.sshd.server.subsystem.sftp.SftpEventListener; -import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory; +import org.apache.sshd.sftp.server.AbstractSftpEventListenerAdapter; +import org.apache.sshd.sftp.server.SftpEventListener; +import org.apache.sshd.sftp.server.SftpSubsystemFactory; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.util.StringUtils; @@ -159,6 +159,10 @@ protected void startup() { sshd.setKeyPairProvider(resourceKeyPairProvider); } + List availableSignatureFactories = sshd.getSignatureFactoriesNames(); + availableSignatureFactories.add("ssh-dss"); + sshd.setSignatureFactoriesNames(availableSignatureFactories); + // Authentication boolean authFound = false; if (password != null) { diff --git a/pom.xml b/pom.xml index b52fc3e89c..178bad1704 100644 --- a/pom.xml +++ b/pom.xml @@ -167,8 +167,8 @@ 3.7.0 4.1.21 1.1.8.4 - 2.5.1 - 1.68 + 2.7.0 + 1.69 0.1.55 2.2.14 2.2