Using implicit Ftps

Hey guys,

I’m trying to use implicit FTPS.

In the documentation, there is written

Use it to configure any custom parameters the server may require, such as explicit or implicit data transfer encryption.
FTP • Alpakka Documentation

The FTPSClient has a isImpicit flag internally but it’s final.
In the example, I can only modify an already created FTPSClient.

FtpsSettings.create(InetAddress.getByName(HOSTNAME))
        .withPort(PORT)
        .withCredentials(CREDENTIALS)
        .withBinary(true)
        .withPassiveMode(true)
        .withConfigureConnectionConsumer(
            (FTPSClient ftpClient) -> {
                // ftpClient.setImplicit(true) not possible because its final
              });

How I can configure implicit FTPS?

Best
Sigurd

Looks like the docs are wrong about being able to configure implicit, and that it would need explicit support added in the FTP connector (passing that flag at construction).

I found a very old pull request about that.

There, the flag was skipped because of the configureConnection method.
Also in very old versions of Apache Commons net (e.g. 3.0) the flag is final.
That is confusing.

Hi team

Is there any update on this one?.

As @sigurd points out with the Apache Commons Net FTPSClient FTPSClient (Apache Commons Net 3.11.1 API) the flag is immutable on creation

Looking at
akka.stream.alpakka.ftp.impl.FtpSourceFactory

 protected val ftpClient: () => FTPSClient = () => new FTPSClient

declared inside a package private trait that as annotated as an internal API.

It is using the default constructor of org.apache.commons.net.ftp.FTPSClient

whose javadoc states

Constructor for FTPSClient, calls [FTPSClient(String, boolean)]

Sets protocol to DEFAULT_PROTOCOL - i.e. TLS - and security mode to explicit (isImplicit = false)

And the isImplicit field of FTPSClient is immutable

It is not clear how implicit FTPs is possible here

Thanks in advance