【发布时间】:2014-12-17 03:40:08
【问题描述】:
我正在尝试使用文件连接器作为入站端点在 Mule 中创建 RESTful 服务,当文件存在时,应将其推送到 HTTPS 端点。使用下面的问题作为起点,我尝试遵循这种方法。没有返回异常,文件没有传输。
How to upload multiple files via REST over HTTP using Mule?
在这个问题中,有一条关于未设置内容类型的评论,我遇到了同样的问题,但出于测试的目的,我试图推送一个文本文件。
<file:connector name="File" autoDelete="false" streaming="true" validateConnections="true" doc:name="File"/>
<https:connector name="HTTP_HTTPS" cookieSpec="netscape" validateConnections="true" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0" doc:name="HTTP-HTTPS">
<https:tls-key-store path="keystore.jks" keyPassword="PASS" storePassword="PASS"/>
<https:tls-server path="nr_up_truststore.ts" storePassword="PASS"/>
</https:connector>
<flow name="Flow1" doc:name="Flow1">
<file:inbound-endpoint path="Path" responseTimeout="10000" doc:name="File" connector-ref="File" disableTransportTransformer="true">
<file:filename-regex-filter pattern="file(.*).txt" caseSensitive="false"/>
</file:inbound-endpoint>
<object-to-byte-array-transformer encoding="ISO-8859-5" doc:name="Object to Byte Array"/>
<https:outbound-endpoint exchange-pattern="request-response" host="host" port="443" method="POST" doc:name="HTTP" connector-ref="HTTP_HTTPS" path="PATH" mimeType="text/plain" password="PASS" user="USER"/>
</flow>
有以下异常堆栈
异常堆栈是: 1. 未找到可信证书(sun.security.validator.ValidatorException) sun.security.validator.SimpleValidator:-1 (null) 2. sun.security.validator.ValidatorException: 找不到受信任的证书 (javax.net.ssl.SSLHandshakeException) sun.security.ssl.Alerts:-1 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/net/ssl/SSLHandshakeException.html) 3. 无法通过端点路由事件:DefaultOutboundEndpoint{endpointUri=https://:@URL, connector-HttpsConnector
【问题讨论】:
-
能否设置org.apache.http.wire的调试级别来调试并分享结果?
-
更新为显示没有受信任的证书堆栈
-
为了尝试创建 SSL 连接,我首先创建了一个 keytool,然后导出到客户端存储证书,最后使用客户端证书创建了一个信任库。