How to use FTPS (implicit)

The topic How to use FTPS (introduction) describes the FTPS features of SSLFTPClient. This topic demonstrates the use of implicit FTPS.

Implicit FTPS is very similar to explicit FTPS (which is the default). Implicit FTPS is an older (and obsolete) form of FTPS which connects on a different port (usually 990) from standard FTP (which is 21). It is not recommended for deployment in new systems and is included in this library mainly for compatibility with legacy systems.

To use implicit FTPS, the setImplicitFTPS method should be used before connecting.

A different auth method is used after connect, which takes a char parameter indicating whether data channels are encrypted or not. PROT_PRIVATE indicates that data channels are encrypted, while PROT_CLEAR indicates that clear data channels are required. This is the same parameter supplied to the prot method in explicit FTPS, and it has the same meaning.

Some servers may not require the auth method to be called at all.

An example is shown below:

ftp.setImplicitFTPS(true);
ftp.connect();
ftp.auth(SSLFTPClient.PROT_PRIVATE);

Apart from the changes in the example above, everything else is the same as with explicit FTPS.