apache-camel - https4 apache camel 给出的主机名与对端提供的证书主题不匹配
问题描述
我正在尝试在 Spring DSL 中建立与 apache camel 的 https 连接。按照本教程:https ://access.redhat.com/documentation/en-us/red_hat_jboss_fuse/6.2/html/apache_camel_component_reference/IDU-HTTP4
还有:http ://camel.apache.org/http4.html
我构造了以下代码:
<sslContextParameters id="sslContextParameters" xmlns="http://camel.apache.org/schema/blueprint">
<trustManagers>
<keyStore resource="keyStore/keyStore.jks" password="changeit"/>
</trustManagers>
</sslContextParameters>
和我的路线:
<route id="axis_camera">
<to uri = "https4://my_ip_adress?sslContextParametersRef=sslContextParameters"
</route>
和
<bean id="http-ssl" class="org.apache.camel.component.http4.HttpComponent">
<property name="sslContextParameters" ref="sslContextParameters"/>
</bean>
在 apache servicemix 上运行它时,我得到:
javax.net.ssl.SSLPeerUnverifiedException: Host name my_ip_adress does not
match the certificate subject provided by the peer (CN=axis-accc8ec51452,
O=Axis Communications AB)
现在我可以在证书中看到该主机名未在主题中定义。我已经看到无法编辑证书,所以我的问题是如何调整此代码以使其读取正确的主机名?
解决方案
这是基于可用信息的疯狂猜测,但请尝试一下。您的证书 CN 是axis-accc8ec51452
您应该连接到此主机名,而不是my_ip_address
.
要将主机名映射axis-accc8ec51452
到my_ip_address
,请在您的 DNS 解析器中更新它或将其添加到您的hosts
文件中 (*nix : /etc/hosts
| Windows: c:\Windows\System32\Drivers\etc\hosts
)
推荐阅读
- java - 无法从 START_OBJECT 令牌中反序列化 PaymentResponse[] 的实例
- android-studio - 无法启动安卓模拟器
- java - 如何在 Java 11 中使用没有 JRE 的 JDK
- python - 如何在python中比较表情符号
- php - 基于对象属性将对象数组拆分为PHP中的新数组
- javascript - 为什么在这种特殊情况下事件处理程序不起作用?
- android - 从 FireBase 中检索数据并在单击按钮时一一显示 CardView
- twitter-bootstrap - 引导程序的哪些文件应该在索引文件中
- c# - C#用单引号替换双引号
- gpu - 设置CarND环境,报错:AttributeError: _DistInfoDistribution__dep_map