You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2013/09/17 05:46:48 UTC
[3/9] git commit: CAMEL-6757 support the StrictHostKeyChecking option
with thanks to Guy
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 <ni...@apache.org>
Authored: Tue Sep 17 11:30:02 2013 +0800
Committer: Willem Jiang <ni...@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(),