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/bc6e7908 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bc6e7908 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bc6e7908 Branch: refs/heads/master Commit: bc6e7908d969a40e46608ffa4a77f9e0b83c455f Parents: 11cab47 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:30:58 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/bc6e7908/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/bc6e7908/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 a34cb28..5759c55 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(),