Skip to content

Commit

Permalink
support ftps implicit mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Jan 9, 2024
1 parent 8b4d6f7 commit b01b6e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package org.apache.pekko.stream.connectors.ftp.impl

import java.net.InetAddress

import com.typesafe.config.ConfigFactory
import org.apache.pekko
import pekko.annotation.InternalApi
import pekko.stream.connectors.ftp.FtpCredentials
Expand Down Expand Up @@ -164,11 +165,16 @@ private[ftp] trait FtpsSource extends FtpSourceFactory[FTPSClient, FtpsSettings]
protected final val FtpsDirectorySource = "FtpsDirectorySource"
protected final val FtpsIOSinkName = "FtpsIOSink"

protected val ftpClient: () => FTPSClient = () => new FTPSClient
protected val ftpClient: () => FTPSClient = () => new FTPSClient(useFtpsImplicit())
protected val ftpBrowserSourceName: String = FtpsBrowserSourceName
protected val ftpIOSourceName: String = FtpsIOSourceName
protected val ftpIOSinkName: String = FtpsIOSinkName
override protected val ftpDirectorySourceName: String = FtpsDirectorySource

private def useFtpsImplicit(): Boolean = {
val cfg = ConfigFactory.load()
cfg.getBoolean("pekko.connectors.ftp.ftps-implicit")
}
}

/**
Expand Down
6 changes: 6 additions & 0 deletions ftp/src/resources/reference.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

pekko.connectors.ftp {
# whether to use FTPS implicit mode (default: false) - see https://en.wikipedia.org/wiki/FTPS
ftps-implicit = false
}

0 comments on commit b01b6e3

Please sign in to comment.