This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-4.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.18.x by this push:
new 435d8bc747bd [backport camel-4.18.x] CAMEL-27229: camel-ftp - ftps
checks the server certificate against the JVM trust store when no trust store
is configured (#30383)
435d8bc747bd is described below
commit 435d8bc747bd263e73e68c108d1154675e8f4430
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Nov 19 13:01:03 2026 +0100
[backport camel-4.18.x] CAMEL-27229: camel-ftp - ftps checks the server
certificate against the JVM trust store when no trust store is configured
(#30383)
An ftps endpoint configured with neither sslContextParameters nor the
ftpClient.trustStore options kept the default trust manager of Commons
Net, which only checks the validity dates of the server certificate.
It now uses the default trust store of the JVM. The endpoints with
sslContextParameters, the ftpClient.trustStore options or a custom
ftpClient are unchanged.
The FTPS integration tests configure a trust store for the certificate
of the test server.
Backport of #30373 (cherry picked from commit c57d0d8cbc47).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
---
.../camel-ftp/src/main/docs/ftp-component.adoc | 29 ++++--
.../camel/component/file/remote/FtpsEndpoint.java | 4 +
.../file/remote/FtpsEndpointTrustManagerTest.java | 101 +++++++++++++++++++++
.../FileToFtpsExplicitSSLWithClientAuthIT.java | 3 +-
.../FileToFtpsExplicitSSLWithoutClientAuthIT.java | 2 +-
.../FileToFtpsExplicitTLSWithClientAuthIT.java | 3 +-
.../FileToFtpsExplicitTLSWithoutClientAuthIT.java | 2 +-
.../FileToFtpsImplicitSSLWithClientAuthIT.java | 3 +-
.../FileToFtpsImplicitSSLWithoutClientAuthIT.java | 2 +-
.../FileToFtpsImplicitTLSWithClientAuthIT.java | 3 +-
.../FileToFtpsImplicitTLSWithoutClientAuthIT.java | 2 +-
.../FileToFtpsWithDefaultSettingsIPV6IT.java | 3 +-
.../FileToFtpsWithDefaultSettingsIT.java | 3 +-
.../remote/integration/FtpsServerTestSupport.java | 6 ++
14 files changed, 148 insertions(+), 18 deletions(-)
diff --git a/components/camel-ftp/src/main/docs/ftp-component.adoc
b/components/camel-ftp/src/main/docs/ftp-component.adoc
index bfeb8d0ae1ca..67b217e73d0f 100644
--- a/components/camel-ftp/src/main/docs/ftp-component.adoc
+++ b/components/camel-ftp/src/main/docs/ftp-component.adoc
@@ -105,14 +105,27 @@ earlier versions, use
`ftpClient.endpointCheckingEnabled=true` as shown above.
=== FTPS component default trust store
-When using the `ftpClient.` properties related to SSL with the FTPS
-component, the trust store accepts all certificates. If you only want
-trust selective certificates, you have to configure the trust store with
-the `ftpClient.trustStore.xxx` options or by configuring a custom
-`ftpClient`.
-
-When using `sslContextParameters`, the trust store is managed by the
-configuration of the provided SSLContextParameters instance.
+Without trust settings, an `ftps` endpoint checks the certificate of the
server against the default trust store of the
+JVM: the `cacerts` file of the JDK, or the trust store set with the
`javax.net.ssl.trustStore` system property. A server
+certificate signed by a public certificate authority needs no configuration.
+
+For a server with a self-signed certificate, or a certificate signed by your
own certificate authority, put that
+certificate (or the certificate of the authority) in a trust store and
configure the endpoint with one of:
+
+* the `ftpClient.trustStore.` options: `ftpClient.trustStore.file`,
`ftpClient.trustStore.password`, and optionally
+`ftpClient.trustStore.type` (the default key store type of the JVM by default)
and `ftpClient.trustStore.algorithm`
+(the default trust manager algorithm of the JVM by default).
+* `sslContextParameters`: the trust store is then the one of the provided
SSLContextParameters instance, and the
+`ftpClient.keyStore.` and `ftpClient.trustStore.` options are not used.
+
+[source,text]
+----
+ftps://admin@myserver/inbox?password=RAW(secret)&ftpClient.trustStore.file=/etc/camel/ftps-truststore.p12&ftpClient.trustStore.type=PKCS12&ftpClient.trustStore.password=RAW(changeit)
+----
+
+A custom `ftpClient` (an `FTPSClient` instance) keeps the trust manager it was
created with: Camel does not change it.
+To check the server certificate in another way, configure the trust manager
yourself, on a custom `ftpClient` with
+`setTrustManager`, or with the trust managers of `sslContextParameters`.
You can configure additional options on the `ftpClient` and
`ftpClientConfig` from the URI directly by using the `ftpClient.` or
diff --git
a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsEndpoint.java
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsEndpoint.java
index 7223f29c5a7b..7e1988c00776 100644
---
a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsEndpoint.java
+++
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsEndpoint.java
@@ -39,6 +39,7 @@ import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPClientConfig;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPSClient;
+import org.apache.commons.net.util.TrustManagerUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -161,6 +162,9 @@ public class FtpsEndpoint extends FtpEndpoint<FTPFile> {
trustMgrFactory.init(trustStore);
client.setTrustManager(trustMgrFactory.getTrustManagers()[0]);
+ } else {
+ // without trust store options, check the server certificate
against the JVM default trust store
+
client.setTrustManager(TrustManagerUtils.getDefaultTrustManager(null));
}
}
diff --git
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpsEndpointTrustManagerTest.java
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpsEndpointTrustManagerTest.java
new file mode 100644
index 000000000000..8542001906df
--- /dev/null
+++
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpsEndpointTrustManagerTest.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.file.remote;
+
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.KeyStore;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.X509TrustManager;
+
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.apache.commons.net.ftp.FTPSClient;
+import org.apache.commons.net.util.TrustManagerUtils;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+/**
+ * The trust manager of the FTPS client that the endpoint creates. The
certificate of the test server is self-signed and
+ * only in src/test/resources/server.jks.
+ */
+public class FtpsEndpointTrustManagerTest extends CamelTestSupport {
+
+ private static final String TRUST_STORE_OPTIONS
+ =
"ftpClient.trustStore.file=./src/test/resources/server.jks&ftpClient.trustStore.type=JKS"
+ + "&ftpClient.trustStore.password=password";
+
+ @BindToRegistry("customFtpClient")
+ private final FTPSClient customFtpClient = new FTPSClient();
+
+ @Test
+ public void createdClientWithoutTrustSettingsUsesJvmDefaultTrustStore()
throws Exception {
+ FtpsEndpoint endpoint = context.getEndpoint("ftps://localhost/dir",
FtpsEndpoint.class);
+
+ FTPSClient client = (FTPSClient) endpoint.createFtpClient();
+
+
assertEquals(TrustManagerUtils.getDefaultTrustManager(null).getClass(),
client.getTrustManager().getClass());
+ }
+
+ @Test
+ public void
createdClientWithoutTrustSettingsRejectsServerCertificateNotInTrustStore()
throws Exception {
+ FtpsEndpoint endpoint = context.getEndpoint("ftps://localhost/dir",
FtpsEndpoint.class);
+ X509Certificate[] chain = serverCertificateChain();
+
+ X509TrustManager trustManager
+ = assertInstanceOf(X509TrustManager.class, ((FTPSClient)
endpoint.createFtpClient()).getTrustManager());
+
+ assertThrows(CertificateException.class, () ->
trustManager.checkServerTrusted(chain, "RSA"));
+ }
+
+ @Test
+ public void
createdClientWithTrustStoreOptionsAcceptsServerCertificateInTrustStore() throws
Exception {
+ FtpsEndpoint endpoint = context.getEndpoint("ftps://localhost/dir?" +
TRUST_STORE_OPTIONS, FtpsEndpoint.class);
+ X509Certificate[] chain = serverCertificateChain();
+
+ X509TrustManager trustManager
+ = assertInstanceOf(X509TrustManager.class, ((FTPSClient)
endpoint.createFtpClient()).getTrustManager());
+
+ assertDoesNotThrow(() -> trustManager.checkServerTrusted(chain,
"RSA"));
+ }
+
+ @Test
+ public void customFtpClientKeepsItsTrustManager() throws Exception {
+ X509TrustManager before = assertInstanceOf(X509TrustManager.class,
customFtpClient.getTrustManager());
+ FtpsEndpoint endpoint =
context.getEndpoint("ftps://localhost/dir?ftpClient=#customFtpClient",
FtpsEndpoint.class);
+
+ endpoint.createRemoteFileOperations();
+
+ assertSame(before, customFtpClient.getTrustManager());
+ }
+
+ private static X509Certificate[] serverCertificateChain() throws Exception
{
+ KeyStore keyStore = KeyStore.getInstance("JKS");
+ try (InputStream is =
Files.newInputStream(Paths.get("src/test/resources/server.jks"))) {
+ keyStore.load(is, "password".toCharArray());
+ }
+ return new X509Certificate[] { (X509Certificate)
keyStore.getCertificate("ftpserver") };
+ }
+}
diff --git
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitSSLWithClientAuthIT.java
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitSSLWithClientAuthIT.java
index 7dd2bdaed6dc..60b966028b32 100644
---
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitSSLWithClientAuthIT.java
+++
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitSSLWithClientAuthIT.java
@@ -30,7 +30,8 @@ public class FileToFtpsExplicitSSLWithClientAuthIT extends
FtpsServerExplicitSSL
return "ftps://admin@localhost:{{ftp.server.port}}"
+
"/tmp2/camel?password=admin&initialDelay=2000&disableSecureDataChannelDefaults=true"
+
"&securityProtocol=SSLv3&implicit=false&ftpClient.keyStore.file=./src/test/resources/server.jks&ftpClient.keyStore.type=JKS"
- +
"&ftpClient.keyStore.algorithm=SunX509&ftpClient.keyStore.password=password&ftpClient.keyStore.keyPassword=password&delete=true";
+ +
"&ftpClient.keyStore.algorithm=SunX509&ftpClient.keyStore.password=password&ftpClient.keyStore.keyPassword=password&delete=true"
+ + TRUST_STORE_OPTIONS;
}
@Disabled("CAMEL-16784:Disable testFromFileToFtp tests")
diff --git
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitSSLWithoutClientAuthIT.java
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitSSLWithoutClientAuthIT.java
index cbe679940b0e..dd1c66572bb2 100644
---
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitSSLWithoutClientAuthIT.java
+++
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitSSLWithoutClientAuthIT.java
@@ -31,7 +31,7 @@ public class FileToFtpsExplicitSSLWithoutClientAuthIT extends
FtpsServerExplicit
protected String getFtpUrl() {
return "ftps://admin@localhost:{{ftp.server.port}}"
+
"/tmp2/camel?password=admin&initialDelay=2000&disableSecureDataChannelDefaults=true&delete=true"
- + "&securityProtocol=SSLv3&implicit=false";
+ + "&securityProtocol=SSLv3&implicit=false" +
TRUST_STORE_OPTIONS;
}
@Disabled("CAMEL-16784:Disable testFromFileToFtp tests")
diff --git
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitTLSWithClientAuthIT.java
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitTLSWithClientAuthIT.java
index e075c33f3397..85b1ee70f783 100644
---
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitTLSWithClientAuthIT.java
+++
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitTLSWithClientAuthIT.java
@@ -32,7 +32,8 @@ public class FileToFtpsExplicitTLSWithClientAuthIT extends
FtpsServerExplicitTLS
return "ftps://admin@localhost:{{ftp.server.port}}"
+
"/tmp2/camel?password=admin&initialDelay=2000&disableSecureDataChannelDefaults=true"
+
"&securityProtocol=TLSv1.3&implicit=false&ftpClient.keyStore.file=./src/test/resources/server.jks&ftpClient.keyStore.type=JKS"
- +
"&ftpClient.keyStore.algorithm=SunX509&ftpClient.keyStore.password=password&ftpClient.keyStore.keyPassword=password&delete=true";
+ +
"&ftpClient.keyStore.algorithm=SunX509&ftpClient.keyStore.password=password&ftpClient.keyStore.keyPassword=password&delete=true"
+ + TRUST_STORE_OPTIONS;
}
@Disabled("CAMEL-16784:Disable testFromFileToFtp tests")
diff --git
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitTLSWithoutClientAuthIT.java
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitTLSWithoutClientAuthIT.java
index 9122300cd8ec..46ff6b74a235 100644
---
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitTLSWithoutClientAuthIT.java
+++
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsExplicitTLSWithoutClientAuthIT.java
@@ -31,7 +31,7 @@ public class FileToFtpsExplicitTLSWithoutClientAuthIT extends
FtpsServerExplicit
protected String getFtpUrl() {
return "ftps://admin@localhost:{{ftp.server.port}}"
+
"/tmp2/camel?password=admin&initialDelay=2000&disableSecureDataChannelDefaults=true"
- + "&securityProtocol=TLSv1.3&implicit=false&delete=true";
+ + "&securityProtocol=TLSv1.3&implicit=false&delete=true" +
TRUST_STORE_OPTIONS;
}
@Disabled("CAMEL-16784:Disable testFromFileToFtp tests")
diff --git
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitSSLWithClientAuthIT.java
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitSSLWithClientAuthIT.java
index 621105dd6e84..1052b7362651 100644
---
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitSSLWithClientAuthIT.java
+++
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitSSLWithClientAuthIT.java
@@ -32,7 +32,8 @@ public class FileToFtpsImplicitSSLWithClientAuthIT extends
FtpsServerImplicitSSL
return "ftps://admin@localhost:{{ftp.server.port}}"
+
"/tmp2/camel?password=admin&initialDelay=2000&disableSecureDataChannelDefaults=true"
+
"&securityProtocol=SSLv3&implicit=true&ftpClient.keyStore.file=./src/test/resources/server.jks&ftpClient.keyStore.type=JKS"
- +
"&ftpClient.keyStore.algorithm=SunX509&ftpClient.keyStore.password=password&ftpClient.keyStore.keyPassword=password&delete=true";
+ +
"&ftpClient.keyStore.algorithm=SunX509&ftpClient.keyStore.password=password&ftpClient.keyStore.keyPassword=password&delete=true"
+ + TRUST_STORE_OPTIONS;
}
@Disabled("CAMEL-16784:Disable testFromFileToFtp tests")
diff --git
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitSSLWithoutClientAuthIT.java
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitSSLWithoutClientAuthIT.java
index d489a7991d9d..6d7c4aeef7d0 100644
---
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitSSLWithoutClientAuthIT.java
+++
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitSSLWithoutClientAuthIT.java
@@ -31,7 +31,7 @@ public class FileToFtpsImplicitSSLWithoutClientAuthIT extends
FtpsServerImplicit
protected String getFtpUrl() {
return "ftps://admin@localhost:{{ftp.server.port}}"
+
"/tmp2/camel?password=admin&initialDelay=2000&disableSecureDataChannelDefaults=true"
- + "&securityProtocol=SSLv3&implicit=true&delete=true";
+ + "&securityProtocol=SSLv3&implicit=true&delete=true" +
TRUST_STORE_OPTIONS;
}
@Disabled("CAMEL-16784:Disable testFromFileToFtp tests")
diff --git
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitTLSWithClientAuthIT.java
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitTLSWithClientAuthIT.java
index 287f6d415f15..568344354ebd 100644
---
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitTLSWithClientAuthIT.java
+++
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitTLSWithClientAuthIT.java
@@ -32,7 +32,8 @@ public class FileToFtpsImplicitTLSWithClientAuthIT extends
FtpsServerImplicitTLS
return "ftps://admin@localhost:{{ftp.server.port}}"
+
"/tmp2/camel?password=admin&initialDelay=2000&disableSecureDataChannelDefaults=true"
+
"&securityProtocol=TLSv1.3&implicit=true&ftpClient.keyStore.file=./src/test/resources/server.jks&ftpClient.keyStore.type=JKS"
- +
"&ftpClient.keyStore.algorithm=SunX509&ftpClient.keyStore.password=password&ftpClient.keyStore.keyPassword=password&delete=true";
+ +
"&ftpClient.keyStore.algorithm=SunX509&ftpClient.keyStore.password=password&ftpClient.keyStore.keyPassword=password&delete=true"
+ + TRUST_STORE_OPTIONS;
}
@Disabled("CAMEL-16784:Disable testFromFileToFtp tests")
diff --git
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitTLSWithoutClientAuthIT.java
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitTLSWithoutClientAuthIT.java
index fd1fca304f82..be41c6cb3912 100644
---
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitTLSWithoutClientAuthIT.java
+++
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsImplicitTLSWithoutClientAuthIT.java
@@ -31,7 +31,7 @@ public class FileToFtpsImplicitTLSWithoutClientAuthIT extends
FtpsServerImplicit
protected String getFtpUrl() {
return "ftps://admin@localhost:{{ftp.server.port}}"
+
"/tmp2/camel?password=admin&initialDelay=2000&disableSecureDataChannelDefaults=true"
- + "&securityProtocol=TLSv1.3&implicit=true&delete=true";
+ + "&securityProtocol=TLSv1.3&implicit=true&delete=true" +
TRUST_STORE_OPTIONS;
}
@Disabled("CAMEL-16784:Disable testFromFileToFtp tests")
diff --git
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsWithDefaultSettingsIPV6IT.java
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsWithDefaultSettingsIPV6IT.java
index 5cee515a1c6f..19c367f752aa 100644
---
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsWithDefaultSettingsIPV6IT.java
+++
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsWithDefaultSettingsIPV6IT.java
@@ -29,7 +29,8 @@ public class FileToFtpsWithDefaultSettingsIPV6IT extends
FtpsServerExplicitTLSWi
private String getFtpUrl() {
return "ftps://admin@[::1]:{{ftp.server.port}}"
- +
"/tmp2/camel?password=admin&initialDelay=2000&disableSecureDataChannelDefaults=true&delete=true";
+ +
"/tmp2/camel?password=admin&initialDelay=2000&disableSecureDataChannelDefaults=true&delete=true"
+ + TRUST_STORE_OPTIONS;
}
@Test
diff --git
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsWithDefaultSettingsIT.java
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsWithDefaultSettingsIT.java
index df3f0e35a688..a376bc15c195 100644
---
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsWithDefaultSettingsIT.java
+++
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FileToFtpsWithDefaultSettingsIT.java
@@ -30,7 +30,8 @@ public class FileToFtpsWithDefaultSettingsIT extends
FtpsServerExplicitTLSWithou
private String getFtpUrl() {
return "ftps://admin@localhost:{{ftp.server.port}}"
- +
"/tmp2/camel?password=admin&initialDelay=2000&disableSecureDataChannelDefaults=true&delete=true";
+ +
"/tmp2/camel?password=admin&initialDelay=2000&disableSecureDataChannelDefaults=true&delete=true"
+ + TRUST_STORE_OPTIONS;
}
@Disabled("CAMEL-16784:Disable testFromFileToFtp tests")
diff --git
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerTestSupport.java
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerTestSupport.java
index e2086788d633..486cba13cb99 100644
---
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerTestSupport.java
+++
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerTestSupport.java
@@ -24,4 +24,10 @@ import
org.apache.camel.component.file.remote.BaseServerTestSupport;
public abstract class FtpsServerTestSupport extends BaseServerTestSupport {
protected static final String AUTH_VALUE_SSL = "SSLv3";
protected static final String AUTH_VALUE_TLS = "TLSv1.3";
+
+ /**
+ * Endpoint options for a trust store with the certificate of the test
server, which is self-signed.
+ */
+ protected static final String TRUST_STORE_OPTIONS =
"&ftpClient.trustStore.file=./src/test/resources/server.jks"
+ +
"&ftpClient.trustStore.type=JKS&ftpClient.trustStore.password=password";
}