如何处理“主机尝试数据连接x.x.x.x与服务器y.y.y.y不同",它是如何处理主机的. Camel FTP错误? [英] How to handle "Host attempting data connection x.x.x.x is not the same as server y.y.y.y" error with Camel FTP?

查看:273
本文介绍了如何处理“主机尝试数据连接x.x.x.x与服务器y.y.y.y不同",它是如何处理主机的. Camel FTP错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Camel FTP Producer将文件发送到第三方ftp服务器(它将由Amazon托管),并且遇到我以前未见过的Writing File failed with: File operation failed... Host attempting data connection x.x.x.x is not the same as server y.y.y.y的问题

I'm trying to send a file to a third party ftp server (hosted by Amazon it would appear) with a Camel FTP Producer, and am having an issue where I am getting Writing File failed with: File operation failed... Host attempting data connection x.x.x.x is not the same as server y.y.y.y which I've not seen before.

将生产者配置为处于被动模式,并根据TRACE级别的日志将其启用. (尽管错误消息听起来像与主动模式问题有关,但更重要)

The producer is configured to be in passive mode, and according to the logs at TRACE level, this is enabled. (Although the error message sounds like it would relate more to an active mode issue)

y.y.y.y IP地址是nslookup为目标域列出的IP地址之一,因此该位有意义.但是,x.x.x.x IP与另一台Amazon托管服务器有关,因此我认为已经执行了某种移交或负载平衡操作,而FTP客户端不喜欢这种方式.

The y.y.y.y IP address is one of those listed by nslookup for the target domain, so that bit makes sense. However, the x.x.x.x IP relates to a different Amazon hosting server, and so I presume some sort of hand-off or load-balancing has been performed, and the FTP client doesn't like that.

是否可以通过某种方式配置Camel FTP来允许此操作(我想这是一项安全功能),还是应该在被动模式下允许此操作?

Is there some way of configuring Camel FTP to allow this (I'm presuming this is a security feature), or should passive mode allow this anyway?

我对ftp服务器提供商没有任何影响,因此很遗憾,除了我的客户端选项之外,我什么也不能更改.

I have no influence with the ftp server provider, so unfortunately I can't change anything but my client options.

感谢您的光临!

推荐答案

在进行一些挖掘并greping Apache Commons FTP的源代码后,该消息是由客户端中的验证引起的,该验证检查被动模式连接与初始服务器连接相同.

After some digging, and grepping the source code for Apache Commons FTP, the message in question is caused by a validation in the client which checks that the passive mode connection is the same as the initial server connection.

鉴于这似乎是一个负载平衡的系统,所以被动模式数据连接是与目标IP不同的IP,这使验证失败.

Given that this appears to be a load-balanced system, the passive mode data connection is a different IP from the target IP, and this fails the validation.

可以使用Camel FTP通过创建FTPClient的特定实例并将关闭验证"设置为关闭来进行修复.

It can be fixed using Camel FTP by creating a specific instance of the FTPClient and setting remove verification off.

FTPClient ftp = new FTPClient();
ftp.setRemoteVerificationEnabled(false);
registry.put("FTPClient", ftp);

,然后在FTP的URI中引用该对象

and then referencing this object in the URI for FTP

ftp://user@host:21/path?password=xxxx&passiveMode=true&tempPrefix=part.&ftpClient=#FTPClient

很明显,通过禁用此远程验证测试,您使自己更容易受到重定向或拦截的FTP数据的影响,以及将数据发送到您不希望的地方的情况,但是我想您是否担心自己不会这样做?首先仍然要使用未加密的FTP.

Clearly, by disabling this remote verification test you are making yourself more vulnerable to the FTP data being redirected or intercepted and your data being sent somewhere you didn't intend, but I guess if you're worried about that you wouldn't be using still be using unencrypted FTP in the first place.

这篇关于如何处理“主机尝试数据连接x.x.x.x与服务器y.y.y.y不同",它是如何处理主机的. Camel FTP错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆