I'm trying to configure an FTP site with IIS on Windows 10. Active connections made to the server's internal (behind the firewall) address work properly (e.g. 10.0.1.4), but any type of connection (active or passive) to the external IP for the server fails. Passive connections (using these is my goal) fail giving a "Failed to retrieve directory listing" error as follows:
Status: Connecting to XX.XXX.XX.XX:21...
Status: Connection established, waiting for welcome message...
Status: Initializing TLS...
Status: Verifying certificate...
Status: TLS connection established.
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 (XX,XXX,XX,XX,4,2).
Command: LIST
Response: 150 Opening BINARY mode data connection.
Error: The data connection could not be established: ECONNREFUSED -
Connection refused by server
What I've tried:
- Tried both passive and active connections
- Checked the firewall (hardware SonicWall) to ensure that ports 20, 21, and 1025-1048 are all open
- Disabled the Windows firewall on the source and target machines; no other software firewalls are in place. The cable modem's firewall is similarly disabled.
IIS's FTP: Firewall Support is set to 1025-1048 for the Data Channel Port Range, and the External Address of the Firewall is set to the network address of the Sonicwall)
Have tried opening up all ports to the affected server as a test to eliminate port issues
Have checked the IIS FTP log. The log shows the PASV command being processed successfully (code 227), followed by the LIST command failing with a 550 and the control channel closing. No other information of note.
Really stuck here. Any ideas?
Thanks,
-Pete
UPDATE:
Fixed a problem with a virtual directory (a drive letter had changed) in the main tree of the FTP site, and suddenly active connections began to work from both inside and outside the firewall.
Unfortunately, passive connections still fail as follows:
Status: Resolving address of mysite.com
Status: Connecting to xx.xxx.xx.xx:21...
Status: Connection established, waiting for welcome message...
Status: Insecure server, it does not support FTP over TLS.
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
Error: Disconnected from server: ECONNABORTED - Connection aborted
Error: Failed to retrieve directory listing
Status: Disconnected from server