我在 IIS 中设置了一个 FTP 服务器。数据通道端口范围设置为5000-6000,“防火墙外部IP地址”设置为正确的公网IP地址。在此 VM 的 Azure 防火墙中,端口 20,21 和 5000-6000 均已打开。当我尝试使其正常工作时,我暂时禁用了 Windows 虚拟机内的防火墙。
如果我在不使用 SSL 的情况下从 FileZilla 连接,则一切正常。如果我使用 SSL 连接,则会发生以下情况(我已将用户名和 IP 地址更改为 xx 的)
Status: Connecting to x.x.x.x:21...
Status: Connection established, waiting for welcome message...
Response: 220 Microsoft FTP Service
Command: AUTH TLS
Response: 234 AUTH command ok. Expecting TLS Negotiation.
Status: Initializing TLS...
Status: Verifying certificate...
Status: TLS connection established.
Command: USER xx
Response: 331 Password required
Command: PASS ************
Response: 230 User logged in.
Command: OPTS UTF8 ON
Response: 200 OPTS UTF8 command successful - UTF8 encoding now ON.
Command: PBSZ 0
Response: 200 PBSZ command successful.
Command: PROT P
Response: 200 PROT command successful.
Status: Logged in
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is current directory.
Command: TYPE I
Response: 200 Type set to I.
Command: PASV
Response: 227 Entering Passive Mode (x,x,x,x,237,114).
Command: LIST
Response: 150 Opening BINARY mode data connection.
Error: Connection timed out after 20 seconds of inactivity
Error: Failed to retrieve directory listing
Status: Disconnected from server
如果我在不使用 SSL 的情况下连接到服务器,则不存在此问题,文件会列出,并且我可以上传文件,一切正常。