Reputation: 139
I am trying to send the file to sftp using Spring Integration sftp outbound channel adapter.
<int-sftp:outbound-channel-adapter id="sftpOutboundAdapter" session-factory="sftpSessionFactory"channel="sftpChannel" charset="UTF-8" remote-directory="/sftp/home/sftp_foler" remote-filename-generator-expression="'dummy.txt'"/>
I am getting the below error..
Caused by: java.lang.IllegalStateException: failed to connect
at org.springframework.integration.sftp.session.SftpSession.connect(SftpSession.java:272)
at org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:377)
... 42 more
Caused by: com.jcraft.jsch.JSchException: reject HostKey: myHost
at com.jcraft.jsch.Session.checkHost(Session.java:791)
at com.jcraft.jsch.Session.connect(Session.java:342)
at com.jcraft.jsch.Session.connect(Session.java:183)
at org.springframework.integration.sftp.session.SftpSession.connect(SftpSession.java:263)
I guess, I may have to set StrictHostKeyChecking to no, but how to set the value in sftp outbound gateway? Please provide your valuable suggestion.
Upvotes: 3
Views: 3224
Reputation: 121177
Maybe this one:
Previously, the
DefaultSftpSessionFactory
unconditionally allowed connections to unknown hosts. This is now configurable (default false).The factory now requires a configured
knownHosts
file unless theallowUnknownKeys
property istrue
(defaultfalse
).
http://docs.spring.io/spring-integration/reference/html/whats-new.html#_default_sftp_session_factory
Upvotes: 8