0

我正在从头开始编写 FTP 客户端,但无法打开 PASV 连接。服务器似乎发送了正确的端口,但客户端收到了不同的原始字符串,随后无法连接。

这是服务器日志(Filezilla):

2018.07.19 16:29:44 - (not logged in) (x.x.10.33)> Connected on port 21, sending welcome message...
2018.07.19 16:29:44 - (not logged in) (x.x.10.33)> 220 Hello from FileZilla Server 0.9.60 beta
2018.07.19 16:29:44 - (not logged in) (x.x.10.33)> USER test
2018.07.19 16:29:44 - (not logged in) (x.x.10.33)> 331 Password required for test
2018.07.19 16:29:45 - (not logged in) (x.x.10.33)> PASS test
2018.07.19 16:29:45 - test (x.x.10.33)> 230 Logged on
2018.07.19 16:29:45 - test (x.x.10.33)> PASV
2018.07.19 16:29:45 - test (x.x.10.33)> 227 Entering Passive Mode (y,y,105,118,93,232)

这是客户端日志(我的程序):

> USER test
2018.07.19 14.29.02 - 220 Hello from FileZilla Server 0.9.60 beta
2018.07.19 14.29.02 - 331 Password required for test
> PASS test
2018.07.19 14.29.02 - 230 Logged on
> PASV
2018.07.19 14.29.03 - 227 Entering Passive Mode (y,y,105,118,214,224)

显示的输出是从套接字接收的原始数据。所有服务器输出都到达,但 227 响应的端口号错误。我很困惑这怎么可能。

连接是通过从越南到德国的 VPN (OpenVPN),服务器也位于德国。我已经验证 Filezilla 和我的客户端在同一台机器上运行时可以一起工作(没有互联网流量)。我还验证了我的客户端与独立服务器(本地和不安全的互联网)一起工作,所以问题似乎出在 Filezilla 上?

4

0 回答 0