CAMEL-6757 support the StrictHostKeyChecking option with thanks to Guy
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/37d4307f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/37d4307f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/37d4307f Branch: refs/heads/camel-2.11.x Commit: 37d4307f7d2e76f6ef97f2bb10f7ad3dfe593d4f Parents: 32cfbaf Author: Willem Jiang <ningji...@apache.org> Authored: Tue Sep 17 11:30:02 2013 +0800 Committer: Willem Jiang <ningji...@apache.org> Committed: Tue Sep 17 11:45:52 2013 +0800 ---------------------------------------------------------------------- .../java/org/apache/camel/component/jsch/ScpConfiguration.java | 2 +- .../java/org/apache/camel/component/jsch/ScpOperations.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/37d4307f/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpConfiguration.java b/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpConfiguration.java index 86fc170..9bcb2d2 100644 --- a/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpConfiguration.java +++ b/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpConfiguration.java @@ -30,7 +30,7 @@ public class ScpConfiguration extends RemoteFileConfiguration { private String knownHostsFile; private String privateKeyFile; private String privateKeyFilePassphrase; - private String strictHostKeyChecking = "no"; + private String strictHostKeyChecking; private int serverAliveInterval; private int serverAliveCountMax = 1; private String chmod = DEFAULT_MOD; http://git-wip-us.apache.org/repos/asf/camel/blob/37d4307f/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpOperations.java ---------------------------------------------------------------------- diff --git a/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpOperations.java b/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpOperations.java index 2499b66..e397737 100644 --- a/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpOperations.java +++ b/components/camel-jsch/src/main/java/org/apache/camel/component/jsch/ScpOperations.java @@ -236,6 +236,11 @@ public class ScpOperations implements RemoteFileOperations<ScpFile> { session = jsch.getSession(config.getUsername(), config.getHost(), config.getPort()); session.setTimeout(config.getTimeout()); session.setUserInfo(new SessionUserInfo(config)); + + if (ObjectHelper.isNotEmpty(config.getStrictHostKeyChecking())) { + LOG.debug("Using StrickHostKeyChecking: {}", config.getStrictHostKeyChecking()); + session.setConfig("StrictHostKeyChecking", config.getStrictHostKeyChecking()); + } int timeout = config.getConnectTimeout(); LOG.debug("Connecting to {} with {} timeout...", config.remoteServerInformation(),