【问题标题】:Call REST service over https using Apache Camel使用 Apache Camel 通过 https 调用 REST 服务
【发布时间】:2020-11-24 09:13:00
【问题描述】:

我正在使用 Apache Camel Spring DSL 通过 HTTPS 调用 REST 服务。该应用程序是一个 Spring Boot 应用程序,并且在 pom.xml 中添加了依赖 camel-http。我有证书文件 Test.p12 和证书的密码。要在调用 HTTPS URL 时添加证书,我按照中给出的说明进行操作

https://camel.apache.org/components/latest/http-component.html 

并尝试添加以下 bean 定义:

<camel:sslContextParameters
      id="sslContextParameters">
    <camel:keyManagers
        keyPassword="keyPassword">
      <camel:keyStore
          resource="/users/home/server/keystore.jks"
          password="keystorePassword"/>
    </camel:keyManagers>
  </camel:sslContextParameters>

但无法创建 bean。谁能指导我如何在 Camel 中使用 HTTPS 调用 REST 服务以及如何在调用时添加证书?

【问题讨论】:

  • 有什么异常?
  • sslContextParameters 在 XML 中未被识别

标签: spring-boot rest https apache-camel ssl-certificate


【解决方案1】:

查看应用程序 YAML(或属性)文件中 SSLContextParameters 的 Spring-Boot 配置。

你可以在bottom of this page找到它。

【讨论】:

  • 这不起作用,我得到了同样的结果:PKIX 路径验证失败
猜你喜欢
  • 1970-01-01
  • 2015-03-30
  • 1970-01-01
  • 2014-02-26
  • 2016-07-05
  • 1970-01-01
  • 1970-01-01
  • 2017-02-20
相关资源
最近更新 更多