Explicit FTPS on Windows Server: Certificate Binding and the Passive-Mode Port Trap

Explicit FTPS is the mode where the client connects to port 21 in cleartext, issues AUTH TLS, and then upgrades the control channel before any credentials are sent. It is the only FTPS mode that works through a plain stateful firewall, which is why it remains the default choice for IIS FTP sites that clients reach over the internet. The two things that break explicit FTPS deployments are almost always the same: the certificate is bound to the wrong site, or the passive data port range is not open in the firewall, so the control channel authenticates and the directory listing hangs forever.

This article walks through a working explicit FTPS configuration on Windows Server with IIS, including the certificate binding step that the GUI makes easy to get wrong, the passive-mode port allocation, and the client-side evidence that tells you which of the two failure modes you are looking at. Server roles and the base FTP feature install are assumed complete; if you are still building the instance, our Windows hosting comparison covers which plans give you the public IP and firewall control this configuration requires.

Explicit vs Implicit: What Changes on the Wire

Implicit FTPS connects to port 990 and begins TLS immediately, with no negotiation step. Explicit FTPS connects to port 21, speaks plain FTP long enough to issue AUTH TLS, and then requires the client to issue PBSZ 0 and PROT P before any data transfer. PROT P is the part people forget: without it, the control channel is encrypted and the file contents are not. A client that shows a padlock and still transfers in cleartext is almost always missing PROT P.

IIS supports explicit FTPS natively through the FTP SSL settings on the site, and it supports implicit only via a registry value that switches the data channel port and makes the site non-standard. Unless a legacy client requires implicit, stay with explicit. It uses one port for the control channel, survives NAT more predictably, and every current client — FileZilla, WinSCP, curl, .NET’s FtpWebRequest — supports it.

Certificate Binding: The Step That Fails Silently

In IIS Manager, the FTP SSL settings dialog lets you select a certificate from a dropdown that lists every certificate in the local machine store, not just the ones valid for the site’s hostname. Selecting the wrong one produces a server that accepts connections and then fails the TLS handshake with a name mismatch, which many clients report as a generic “connection closed” error. Bind by thumbprint rather than by friendly name, and confirm the subject alternative name includes the hostname clients actually use to connect — not the server’s internal name.

The reliable way to bind is from the configuration API rather than the GUI. Add the certificate to the site’s ftpServer/security/authentication/ssl section with the thumbprint, set controlChannelPolicy to SslAllow during rollout and SslRequire once every client is confirmed working, and set dataChannelPolicy to SslRequire. Verify the binding with a quick OpenSSL handshake against port 21 after issuing the AUTH command; if openssl s_client -starttls ftp returns the certificate you expect, the binding is correct and any remaining failure is in the data channel.

Passive Mode and the Port Range Trap

In passive mode the server tells the client which port to connect to for the data channel. By default IIS lets Windows pick an ephemeral port from the dynamic range, and on a server behind a firewall or a cloud security group, that port is almost certainly not open. The control channel authenticates, the client issues PASV, receives an address and port, and then hangs on the directory listing until it times out. This is the single most common explicit FTPS failure and it looks identical to a certificate problem in the client log unless you read the PASV response.

Fix it by defining a fixed passive port range in the FTP firewall support settings — something like 50000 through 50100 — and opening exactly that range in the firewall and in any upstream security group or NAT device. Then set the external IP address of the firewall so the server advertises the public address in the PASV response rather than its private one; without this, clients on the internet are told to connect to an unroutable address and fail with a completely different error.

Firewall Rules That Match the Configuration

Three inbound rules are needed: port 21 for the control channel, the passive range for data connections, and nothing else. Create them as a single named group so they can be reviewed and removed together, and scope the passive range rule to the same source addresses as port 21 if you can. Note that FTP data connections originate from the client, so “inbound” here means inbound to the server from an arbitrary client address — you cannot restrict the passive range to the management network unless every client lives there.

On the client side, restrict the client to the same passive range you configured on the server. FileZilla’s “Passive mode settings” and WinSCP’s advanced transfer settings both allow a port range constraint; setting it prevents the client from trying ports the server will never use and makes failures immediate rather than delayed by a 20-second timeout. Immediate failure is a feature during troubleshooting.

Authentication, Isolation, and Permissions

Enable basic authentication over the TLS channel and disable anonymous authentication entirely. For IIS Manager authentication, prefer Windows accounts with an FTP authorization rule scoped to the specific virtual directory rather than broad Administrators access. FTP user isolation set to “User name directory” keeps each account confined to its own folder, which matters far more on a multi-tenant server than on a single-purpose one.

NTFS permissions are what actually enforce the isolation; the FTP authorization rule only decides who may log in. Grant the FTP account modify rights on its own directory and nothing above it, and remove inherited permissions on the root FTP folder so that a misconfigured account cannot walk upward. Verify by logging in with a test account and attempting to change directory to a sibling folder — the client should receive a 550 and the server log should record the attempt.

Validating the Whole Chain

Validate in this order and stop at the first failure: TLS handshake on port 21, successful logon, PBSZ and PROT accepted, PASV returns the public address and an in-range port, data connection establishes, and finally an upload and download complete. Testing with curl -v --ftp-ssl --ftp-pasv -T file.txt ftp://host/ gives you the full negotiation in one transcript, which is far more useful than a GUI client’s summary log.

Once it works, freeze the configuration: export the IIS configuration section, record the certificate thumbprint and its expiry date, and note the passive range in the change record. Certificate expiry is the most common cause of an FTPS site that “suddenly stopped working” six months later, and a calendar entry tied to the thumbprint expiry is cheaper than the incident review. For a full walkthrough of the prerequisite server configuration, see the full setup guide here before you begin.

Leave a Comment