当我从客户端向ESB发送请求时,我正在运行ESB Mule 3.7.0,得到以下错误:
ERROR 2015-12-21 18:15:24,859 [[my-project].http.request.dispatch.443.41] org.mule.exception.DefaultSystemExceptionStrategy: Caught exception in Exception Strategy: Remote host closed connection during handshake javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:953) ~[?:1.7.0_80]
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332) ~[?:1.7.0_80]
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:889) ~[?:1.7.0_80]
at sun.security.ssl.AppInputStream.read(AppInputStream.java:102) ~[?:1.7.0_80]
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) ~[?:1.7.0_80]
at java.io.BufferedInputStream.read(BufferedInputStream.java:254) ~[?:1.7.0_80]
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78) ~[commons-httpclient-3.1.jar:?]
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106) ~[commons-httpclient-3.1.jar:?]
at org.mule.transport.http.HttpServerConnection.readLine(HttpServerConnection.java:245) ~[mule-transport-http-3.7.0.jar:3.7.0]
at org.mule.transport.http.HttpServerConnection.getRequestLine(HttpServerConnection.java:557) ~[mule-transport-http-3.7.0.jar:3.7.0]
at org.mule.transport.http.HttpRequestDispatcherWork.run(HttpRequestDispatcherWork.java:67) ~[mule-transport-http-3.7.0.jar:3.7.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_80]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_80]
at java.lang.Thread.run(Thread.java:745) [?:1.7.0_80] Caused by: java.io.EOFException: SSL peer shut down incorrectly
at sun.security.ssl.InputRecord.read(InputRecord.java:482) ~[?:1.7.0_80]
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:934) ~[?:1.7.0_80]
... 13 more
我的https 连接程序配置如下:
<https:connector name="httpsConnector" doc:name="HTTP\HTTPS" clientSoTimeout="10000" cookieSpec="netscape" receiveBacklog="0" receiveBufferSize="0" sendBufferSize="0" serverSoTimeout="10000" socketSoLinger="0" validateConnections="true">
<receiver-threading-profile maxThreadsActive="${connector.https.maxThreadsActive}" />
<https:tls-key-store path="${tls.keystore.location}" keyPassword="${tls.keystore.password}" storePassword="${tls.keystore.password}"/>
<https:tls-server path="${tls.keystore.location}" storePassword="${tls.keystore.password}"/>
</https:connector>
https:inbound-endpoint的定义为:
<https:inbound-endpoint exchange-pattern="request-response" host="${httpInbound.secure.host}" port="${httpInbound.secure.port}" doc:name="HTTPS Service" path="${httpInbound.contextRoot}/${external.serviceName}" responseTimeout="${service.timeout}" connector-ref="httpsConnector">
<mule-ss:http-security-filter realm="mule-realm"/>
<mule-ss:authorization-filter requiredAuthorities="PUBLIC" />
</https:inbound-endpoint>
为什么我在握手时会收到一个SSLHandshakeException: Remote host closed connection
?有什么想法吗?
发布于 2015-12-21 22:49:45
检查https连接器配置中的证书信息我使用了以下步骤并正确工作
<http:request-config name="SharedHttpsRequestConfig" protocol="HTTPS">
<tls:context>
<tls:trust-store path="${tls.trust.store}" password="${tls.trust.store.password}"/>
<tls:key-store path="${tls.trust.store}" password="${tls.trust.store.password}" keyPassword="${tls.trust.store.key.password}"/>
</tls:context>
</http:request-config>
然后在流中使用上面的https连接器调用https服务。
<http:request config-ref="SharedHttpsRequestConfig"
port="${https.port}" host="#[MYMAP.get('DOMAINS')]"
path="/api/${version}/${.url}"
parseResponse="false" responseTimeout="${es.mule.http.timeout}"
method="POST" doc:name="Service">
发布于 2015-12-21 22:48:23
远程主机可能不喜欢您发送给它的内容,因此最初的TLS握手失败了。这可能有很多原因,比如:
我认为不可能根据你提供的信息提取出确切的原因。但是,由于服务器关闭了连接,我建议在服务器端查看错误(日志文件等)。您还可以尝试与其他客户端连接到服务器,以查看问题是否与客户端配置有关,或者与服务器配置有关。
https://stackoverflow.com/questions/34401463
复制