2015-12-21 55 views
1

握手期間關閉連接我正在ESB騾子3.7.0當我從客戶端發送請求到ESB我得到以下錯誤:ESB騾子3.7.0出現SSLHandshakeException:遠程主機在

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:入站端點定義爲:

<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?有任何想法嗎?

回答

0

遠程主機可能不喜歡您發送給它的內容,因此最初的TLS握手失敗。可能有很多原因造成的,如:

  • 你沒有連接到SSL服務
  • 服務器需要TLS版本不支持你
  • 服務器要求不是你所支持的密碼
  • 服務器需要SNI你也許不使用

我不認爲這是可以提取根據您提供的信息的確切原因。但是,由於服務器關閉連接,我建議查看服務器端的錯誤(日誌文件等)。您也可以嘗試與其他客戶端連接到服務器,以查看問題是否與您的客戶端配置有關,或者與服務器配置有關。

1

檢查我用以下stepes其正常工作

<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"> 
HTTPS連接器配置中的證書信息