Getting started Community Training Tutorials Documentation APIs, AI & Tools
Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files.
To add and configure a connector in Studio:
When you run the connector, you can view the app log to check for problems in real time, as described in View the App Log.
If you are new to configuring connectors in Studio, see Use Studio to Configure a Connector. If, after reading this topic, you need additional information about the connector fields, see the FTPS Connector Reference.
In Studio, create a new Mule project in which to add and configure the connector:
In Studio, select File > New > Mule Project.
Enter a name for your Mule project and click Finish.
Add FTPS Connector to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and to add the required dependencies to the project’s pom.xml file:
In the Mule Palette view, click (X) Search in Exchange.
In the Add Dependencies to Project window, type ftps in the search field.
Click FTPS Connector - Mule 4 in Available modules.
Click Add.
Click Finish.
Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace.
A source initiates a flow when a specified condition is met. You can configure one of these sources to use with FTPS Connector:
On New or Updated File
Initiates a flow by polling a directory for files that have been created or updated and generates a message for each file found.
HTTP Listener
Initiates a flow each time it receives a request on the configured host and port.
Scheduler
Initiates a flow when a time-based condition is met.
For example, to configure the On New or Updated File source, follow these steps:
In the Mule Palette view, select On New or Updated File.
Drag On New or Updated File to the Studio canvas.
On the On New or Updated File configuration screen, optionally change the value of the Display Name field.
Specify a value for the Directory field.
Click the plus sign (+) next to the Connector configuration field to configure a global element that can be used by all instances of On New or Updated File in the app.
On the General tab, specify the connection information for the connector.
Set Host to specify the FTPS server host, for example, localhost or 192.168.0.1.
Click Test Connection to confirm that Mule can connect with the specified server.
Click OK.
On the On New or Updated File configuration screen, specify a Scheduling Strategy value and optionally complete other fields.
In a cluster, including CloudHub 2.0, On New or Updated File polls only on the primary node by default, because Primary Node Only (primaryNodeOnly) defaults to true. To poll on every node, set primaryNodeOnly="false" on the source.
Time Between Size Check and Time Between Size Check Time Unit on the source and on the Read operation override the values set in the connector configuration. If they aren’t set, the configuration values are used. Time Between Size Check Time Unit defaults to SECONDS.
When you add a connector operation to your flow, you immediately define a specific operation for that connector to perform.
To add an operation for FTPS Connector, follow these steps:
In the Mule Palette view, select FTPS and then select the desired operation.
Drag the operation onto the Studio canvas and to the right of the source.
When you configure a connector, it’s best to configure a global element that all instances of that connector in the app can use. Configuring a global element requires you to configure the FTPS server connection.
To configure the global element for FTPS Connector, follow these steps:
Select the name of the connector in the Studio canvas.
Select the operation in the Studio canvas.
In the configuration screen for the operation, click the plus sign (+) next to the Connector configuration field to access the global element configuration fields.
On the General tab, specify the connection information for the connector:
Set the Working Directory as the root of every relative path used with this connector.
If it’s not provided, the value defaults to the remote server. If the directory does not exist, the connection fails with FTPS:FILE_DOESNT_EXIST. If it is a file, the connection fails with FTPS:FILE_IS_NOT_DIRECTORY. If it is a directory the user cannot enter, the connection fails with FTPS:CONNECTIVITY.
Set Host to specify the FTPS server host, for example, localhost or 0.0.0.0.
Set Username and Password.
Configure the Bouncy Castle libraries in the Required Libraries field when the connector reuses TLS sessions through Bouncy Castle. For when the libraries are required, see Configure Bouncy Castle Libraries and Security Provider.
On the Advanced tab, optionally specify a timeout configuration and reconnection strategy. Connection Timeout and Response Timeout default to 10 SECONDS.
On the Proxy tab, optionally configure an HTTP or HTTPS tunnel proxy. For more information, see Configuring a Proxy for FTPS Connector.
On the TLS tab, specify TLS configuration.
Click Test Connection to confirm that Mule can connect with the specified server.
Click OK.
In the Configuration XML editor, the configuration ftps:config looks like this:
<ftps:config name="FTPS_Config">
<ftps:connection username="anonymous" password="password"
host="0.0.0.0" port="21" workingDir="${workingDir}">
<tls:context>
<tls:trust-store path="path/to/keystore" password="mulepassword" />
</tls:context>
</ftps:connection>
</ftps:config>
In the global element configuration, you can configure the Ftps mode field to either the following options:
Ftps explicit mode (Default) The explicit mode connects in an unprotected way to the FTPS server and then upgrades the connection to TLS.
Ftps implicit mode
The implicit mode assumes that a secure connection through an SSL/TLS handshake must take place before any FTP command is sent. This ensures that the entire FTP session is encrypted. Implicit mode has no parameters. The connector sends PROT P after login, and if the server rejects it, the connection fails with the message There was an error while trying to encrypt the data channel (PROT P).
When you configure the Ftps explicit mode (Default), you can also configure the data channel protection level through the PROT Settings field to either one of these options:
CLEAR The clear protection level indicates that the data channel carries the raw data of the file transfer, with no security applied. When the data channel is clear, the connector logs a warning once per configuration.
PRIVATE
The private protection level indicates that the integrity of the data and confidentiality are protected. This is the default value. The connector sends PBSZ 0 and PROT P after login. If the server rejects PROT P, the connection fails. In FTPS Connector 2.x, PROT Settings had no default value, and the data channel stayed clear when it wasn’t set.
In the Configuration XML editor, the ftps:ftps-mode, ftps:ftps-explicit-mode, and protSetting configurations look like this:
<ftps:config name="FTPS_Config">
<ftps:connection username="anonymous" password="password"
host="0.0.0.0" port="21" workingDir="${workingDir}">
<tls:context>
<tls:trust-store path="path/to/keystore" password="mulepassword" />
</tls:context>
<ftps:ftps-mode >
<ftps:ftps-explicit-mode protSetting="PRIVATE" />
</ftps:ftps-mode>
</ftps:connection>
</ftps:config>
In the Configuration XML editor, the ftps:ftps-mode and ftps:ftps-implicit-mode configurations look like this:
<ftps:config name="FTPS_Config">
<ftps:connection username="anonymous" password="password"
host="0.0.0.0" port="21" workingDir="${workingDir}">
<tls:context>
<tls:trust-store path="path/to/keystore" password="mulepassword" />
</tls:context>
<ftps:ftps-mode >
<ftps:ftps-implicit-mode />
</ftps:ftps-mode>
</ftps:connection>
</ftps:config>
You can use Transport Layer Security (TLS) and configure FTPS by providing a key store with your certificate. You can also enable 2-way authentication by providing a trust store. For more information about TLS configuration, refer to the configure TLS with Keystores and Truststores documentation.
If the TLS handshake fails, for example because the server certificate isn’t trusted, the host name doesn’t match, the certificate is expired, or no protocol or cipher suite can be agreed, the connection fails with FTPS:TLS_HANDSHAKE_FAILED. This error is a child of FTPS:CONNECTIVITY.
FTPS servers that require session reuse, such as vsftpd with require_ssl_reuse=YES or ProFTPD, reject the data channel when TLS 1.3 is negotiated. Mule 4.10 and later enables TLS 1.2 and TLS 1.3 by default, so set Enabled Protocols to TLSv1.2 in the TLS context when you connect to these servers.
FTPS servers often require the data channel to reuse the TLS session of the control channel. FTPS Connector reuses the session through one of two security providers:
On Mule 4.13.0 and later, the connector can reuse the session through the Java (JDK) security provider, so it doesn’t need to register the Bouncy Castle security providers for the whole JVM. This mode is opt-in. The connector uses the JDK provider only when all of these conditions are met:
The runtime is Mule 4.13.0 or later.
The jdk.tls.client.enableSessionTicketExtension system property is false.
The jdk.tls.useExtendedMasterSecret system property isn’t set to true.
TLS 1.3 isn’t enabled. The connector checks the jdk.tls.client.protocols system property first and then the Enabled Protocols field of the TLS context. If neither is set, the connector assumes TLS 1.3 is enabled.
The runtime doesn’t run in FIPS mode.
In every other case, the connector reuses the session through Bouncy Castle, as in FTPS Connector 2.x. In FIPS mode, the connector uses the runtime FIPS security providers.
When a data connection resumes the control-channel session, the connector logs Resuming SSL/TLS Session through the JDK provider or Resuming SSL/TLS Session through BC provider at INFO. Selecting the provider and registering Bouncy Castle are logged at DEBUG.
To enable the JDK provider, set the jdk.tls.client.enableSessionTicketExtension=false system property on the runtime. The connector reads it with System.getProperty. In Anypoint Studio and Anypoint Code Builder, add -M-Djdk.tls.client.enableSessionTicketExtension=false to the runtime arguments. In a standalone or hybrid Mule runtime, add -Djdk.tls.client.enableSessionTicketExtension=false to the JVM arguments. In CloudHub 1.0 and CloudHub 2.0, set the application property jdk.tls.client.enableSessionTicketExtension to false. The JDK discards TLS 1.2 session tickets that live longer than 7 days. vsftpd issues tickets with that lifetime, so a data channel that uses those tickets cannot resume and vsftpd returns 522. Keep this property set to false when you use the JDK provider.
On this path the connector does not register Bouncy Castle. A bcfks keystore works only when Bouncy Castle is already registered by something else. Use a jks or pkcs12 keystore.
To reuse sessions using FTPS, you must disable the Extended Master Secret extension for compatibility (JDK-8192045). The JDK enables that extension unless you set jdk.tls.useExtendedMasterSecret to false. The extension protects users from vulnerabilities by using the same session on different groups of clients and servers, which contradicts the demand to use the same session for control and data connections. With the Extended Master Secret extension activated, session reuse is possible only by endpoint verification, which is implemented for HTTPS and LDAP only. The connector treats the property as not true when it is unset, so an unset property still allows the JDK provider. Set it to false so session reuse can succeed.
To disable the extension when working in Anypoint Studio, follow these steps:
In Studio, click Run > Run Configurations….
In the Run Configurations screen, click the (x)=Arguments tab.
In the VM arguments box, add the following argument to the JVM execution:
-M-Djdk.tls.useExtendedMasterSecret=false
Click Apply.
Click Run.
To disable the Extended Master Secret extension when working in a standalone Mule environment, add the following argument to the JVM execution:
./bin/mule -Djdk.tls.useExtendedMasterSecret=false
When the connector reuses TLS sessions through Bouncy Castle, it uses externally provided Bouncy Castle libraries, which it registers as the top security providers. You must add the Bouncy Castle libraries to prevent MITM attacks. If the libraries are missing on that path, the connection fails to start with Unable to register Bouncy Castle Providers. It’ll be vulnerable to MITM Attack. When an app is undeployed, the connector removes the Bouncy Castle security providers that its class loader registered. Providers registered by the runtime or by other apps are kept.
To reuse sessions through Bouncy Castle, configure the Bouncy Castle libraries in the Required Libraries field while configuring the global element for the connector. FTPS Connector 3.0 uses version 1.87 of bcprov-jdk18on, bctls-jdk18on, bcpkix-jdk18on, and bcutil-jdk18on. Studio shows them as BC Provider, BCJSSE Provider, BCPKIX Provider, and BCUTIL Provider.
Studio marks each library as an optional dependency, so a missing library is not rejected when the app is packaged. The libraries are required at runtime whenever the connector uses Bouncy Castle:
On Mule 4.9.0 through 4.12.x the connector uses Bouncy Castle, except in FIPS mode, so the libraries are required.
On Mule 4.13.0 and later the libraries are required unless the JDK provider is in use or the runtime is in FIPS mode.
Add either all four libraries or none of them. Don’t add only some of them.
You can choose one of the three available options to add these libraries.
FTPS Connector 3.0 requires Java 17, which doesn’t support the jre/lib/ext extension folder, so add the Bouncy Castle libraries through the Required Libraries field.
To check for problems, you can view the app log as follows:
If you’re running the app from Anypoint Platform, the output is visible in the Anypoint Studio console window.
If you’re running the app using Mule from the command line, the app log is visible in your OS console.
Unless the log file path is customized in the app’s log file (log4j2.xml), you can also view the app log in the default location MULE_HOME/logs/<app-name>.log.