Spring integration spring集成:sftp入站通道适配器主机的真实性';x、 x.x.x';can';不能成立
我尝试使用以下代码下载文件:Spring integration spring集成:sftp入站通道适配器主机的真实性';x、 x.x.x';can';不能成立,spring-integration,sftp,Spring Integration,Sftp,我尝试使用以下代码下载文件: <int-sftp:inbound-channel-adapter id="sftpInbondAdapter" auto-startup="true" channel="receiveChannel" session-factory="sftpSessionFactory" local-directory="file:${directory.files.local}" remote-directory="${directory.files.r
<int-sftp:inbound-channel-adapter id="sftpInbondAdapter"
auto-startup="true" channel="receiveChannel" session-factory="sftpSessionFactory"
local-directory="file:${directory.files.local}" remote-directory="${directory.files.remote}"
auto-create-local-directory="true" delete-remote-files="true"
filename-pattern="*.txt">
<int:poller fixed-delay="${sftp.interval.request}"
max-messages-per-poll="-1" error-channel="sftp.in.error.channel" />
</int-sftp:inbound-channel-adapter>
<bean id="defaultSftpSessionFactory"
class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
<property name="host" value="${sftp.host}" />
<property name="port" value="${sftp.port}" />
<property name="user" value="${user}" />
<property name="password" value="${password}" />
<property name="allowUnknownKeys" value="true" />
</bean>
我也希望org.springframework.integration
最后一条消息来自此代码
@Override
public boolean promptYesNo(String message) {
logger.info(message); // <<<<<<<<< INFO message in your log line 538
if (hasDelegate()) {
return getDelegate().promptYesNo(message);
}
else {
if (logger.isDebugEnabled()) {
logger.debug("No UserInfo provided - " + message + ", returning:"
+ DefaultSftpSessionFactory.this.allowUnknownKeys);
}
return DefaultSftpSessionFactory.this.allowUnknownKeys;
}
}
“Returning:false”表示
allowunknowkeys
属性是false
,而不是配置中显示的true
。也许您有另一个会话工厂bean覆盖了这个会话工厂?请参阅我的编辑;不知何故,您正在使用的会话工厂没有将allowunknowkeys
设置为true。
@Override
public boolean promptYesNo(String message) {
logger.info(message); // <<<<<<<<< INFO message in your log line 538
if (hasDelegate()) {
return getDelegate().promptYesNo(message);
}
else {
if (logger.isDebugEnabled()) {
logger.debug("No UserInfo provided - " + message + ", returning:"
+ DefaultSftpSessionFactory.this.allowUnknownKeys);
}
return DefaultSftpSessionFactory.this.allowUnknownKeys;
}
}
2016-02-01 18:28:27 DEBUG DefaultSftpSessionFactory:544 - No UserInfo provided - The authenticity of host '192.168.21.36' can't be established.
RSA key fingerprint is 98:1d:7e:73:77:97:f6:af:f9:2a:fc:2b:21:8e:8e:bf.
Are you sure you want to continue connecting?, returning:false