40.6. FTPS 组件默认信任存储


当使用与 FTPS 组件 SSL 相关的 ftpClient. 属性时,信任存储接受所有证书。如果您只想信任选择的证书,您必须使用 ftpClient.trustStore.xxx 选项或配置自定义的 ftpClient 选项来配置信任存储。

使用 sslContextParameters 时,信任存储由提供的 SSLContextParameters 实例的配置来管理。

您可以使用 ftpClient.ftpClientConfig. 前缀直接在 URI 上配置 ftpClientftpClientConfig 上的附加选项。

例如,要将 FTPClient 上的 setDataTimeout 设置为 30 秒,您可以执行以下操作:

from("ftp://foo@myserver?password=secret&ftpClient.dataTimeout=30000").to("bean:foo");

您可以混合和匹配并使用两个前缀,例如配置日期格式或时区。

from("ftp://foo@myserver?password=secret&ftpClient.dataTimeout=30000&ftpClientConfig.serverLanguageCode=fr").to("bean:foo");

您可以根据需要拥有任意数量的选项。

有关可能选项和更多详情,请参阅 Apache Commons FTP FTPClientConfig 的文档。和用于 Apache Commons FTP FTPClient。

如果您不想在 url 中有多个和长的配置,您可以通过让 Registry 中的 Camel 查找来指代 ftpClientftpClientConfig 要使用的 ftpClient 或 ftpClientConfig。

例如:

   <bean id="myConfig" class="org.apache.commons.net.ftp.FTPClientConfig">
       <property name="lenientFutureDates" value="true"/>
       <property name="serverLanguageCode" value="fr"/>
   </bean>

然后,当您在 url 中使用 # 表示法时,请让 Camel 查找这个 bean。

from("ftp://foo@myserver?password=secret&ftpClientConfig=#myConfig").to("bean:foo");
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部