2016-02-19 77 views
1

我在API網關後面的AWS Lambda(node.js)上構建了一些SOAP API。我已經添加了具有可信證書(COMODO RSA證書頒發機構)的自定義域,但是當我嘗試從SoapUI(OSX上的v5.2.1)發出任何請求時,它將以handshake_failure失敗。連接到AWS API網關的SoapUI

API網址:https://arrivacz-custom.bileto.com/terminal

我試圖與證書的公共部分創建密鑰庫並將其添加到 項目設置 - > WS-安全配置 - >密鑰庫和信任庫,但它並沒有幫助。

我也試圖加入幾行代碼添加到了SoapUI /內容/ vmoptions.txt

-Dcom.sun.net.ssl.checkRevocation=false 
-Dsun.security.ssl.allowUnsafeRenegotiation=true 
-Dcom.sun.net.ssl.enableECC=false 
-Djavax.net.debug=all 
-Dsoapui.https.protocols=TLSv1.2 

因爲我需要這只是爲了測試我可以忽略所有SSL錯誤去,但我無法找到怎麼做。

你可以請我建議我如何使這個工作。

了SoapUI錯誤日誌:

Fri Feb 19 11:49:48 CET 2016:ERROR:javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure 
    javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure 
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) 
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154) 
    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1959) 
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1077) 
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312) 
    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:702) 
    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122) 
    at org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:131) 
    at org.apache.http.impl.io.AbstractSessionOutputBuffer.flush(AbstractSessionOutputBuffer.java:138) 
    at org.apache.http.impl.conn.LoggingSessionOutputBuffer.flush(LoggingSessionOutputBuffer.java:95) 
    at org.apache.http.impl.io.ContentLengthOutputStream.flush(ContentLengthOutputStream.java:102) 
    at org.apache.http.entity.ByteArrayEntity.writeTo(ByteArrayEntity.java:69) 
    at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96) 
    at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108) 
    at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:120) 
    at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:263) 
    at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:227) 
    at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:255) 
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpRequestExecutor.doSendRequest(HttpClientSupport.java:119) 
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123) 
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633) 
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454) 
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820) 
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754) 
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.execute(HttpClientSupport.java:233) 
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport.execute(HttpClientSupport.java:323) 
    at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.submitRequest(HttpClientRequestTransport.java:290) 
    at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:220) 
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:119) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at java.lang.Thread.run(Thread.java:745) 

了SoapUI日誌,網絡調試:

Fri Feb 19 11:49:01 CET 2016:INFO:initialized soapui-settings from [/Users/jakubriedl/soapui-settings.xml] 
Fri Feb 19 11:49:01 CET 2016:INFO:Initializing KeyStore 
Fri Feb 19 11:49:02 CET 2016:ERROR:An error occurred [No private keys found in keystore!], see error log for details 
Fri Feb 19 11:49:04 CET 2016:INFO:Adding plugin from [/Users/jakubriedl/.soapuios/plugins/soapui-swagger-plugin-2.2-dist.jar] 
Fri Feb 19 11:49:04 CET 2016:INFO:Adding plugin from [/Users/jakubriedl/.soapuios/plugins/ready-uxm-plugin-1.0.1-dist.jar] 
Fri Feb 19 11:49:05 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoDiscoveryMethodFactory], see error log for details 
Fri Feb 19 11:49:05 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoImportMethodFactory], see error log for details 
Fri Feb 19 11:49:05 CET 2016:INFO:Adding plugin from [/Users/jakubriedl/.soapuios/plugins/ready-mqtt-plugin-dist.jar] 
Fri Feb 19 11:49:05 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoDiscoveryMethodFactory], see error log for details 
Fri Feb 19 11:49:05 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoImportMethodFactory], see error log for details 
Added AutoFactory for [PluginPrefs] 
Added AutoFactory for [PluginPanelBuilder] 
Added AutoFactory for [PluginPanelBuilder] 
Added AutoFactory for [PluginPanelBuilder] 
Added AutoFactory for [PluginTestStep] 
Added AutoFactory for [PluginTestStep] 
Added AutoFactory for [PluginTestStep] 
Fri Feb 19 11:49:06 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoDiscoveryMethodFactory], see error log for details 
Fri Feb 19 11:49:06 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoImportMethodFactory], see error log for details 
Fri Feb 19 11:49:06 CET 2016:INFO:Adding plugin from [/Users/jakubriedl/.soapuios/plugins/readyapi-swaggerhub-plugin-1.0.jar] 
Fri Feb 19 11:49:06 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoDiscoveryMethodFactory], see error log for details 
Fri Feb 19 11:49:06 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoImportMethodFactory], see error log for details 
Fri Feb 19 11:49:06 CET 2016:INFO:4 plugins loaded in 2112 ms 
Fri Feb 19 11:49:06 CET 2016:INFO:All plugins loaded 
Fri Feb 19 11:49:06 CET 2016:INFO:initialized soapui-settings from [/Users/jakubriedl/soapui-settings.xml] 
Fri Feb 19 11:49:07 CET 2016:INFO:Adding plugin from [/Users/jakubriedl/.soapuios/plugins/soapui-swagger-plugin-2.2-dist.jar] 
Fri Feb 19 11:49:07 CET 2016:INFO:Adding plugin from [/Users/jakubriedl/.soapuios/plugins/ready-uxm-plugin-1.0.1-dist.jar] 
Fri Feb 19 11:49:08 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoDiscoveryMethodFactory], see error log for details 
Fri Feb 19 11:49:08 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoImportMethodFactory], see error log for details 
Fri Feb 19 11:49:08 CET 2016:INFO:Adding plugin from [/Users/jakubriedl/.soapuios/plugins/ready-mqtt-plugin-dist.jar] 
Fri Feb 19 11:49:08 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoDiscoveryMethodFactory], see error log for details 
Fri Feb 19 11:49:08 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoImportMethodFactory], see error log for details 
Added AutoFactory for [PluginPrefs] 
Added AutoFactory for [PluginPanelBuilder] 
Added AutoFactory for [PluginPanelBuilder] 
Added AutoFactory for [PluginPanelBuilder] 
Added AutoFactory for [PluginTestStep] 
Added AutoFactory for [PluginTestStep] 
Added AutoFactory for [PluginTestStep] 
Fri Feb 19 11:49:08 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoDiscoveryMethodFactory], see error log for details 
Fri Feb 19 11:49:08 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoImportMethodFactory], see error log for details 
Fri Feb 19 11:49:08 CET 2016:INFO:Adding plugin from [/Users/jakubriedl/.soapuios/plugins/readyapi-swaggerhub-plugin-1.0.jar] 
Fri Feb 19 11:49:09 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoDiscoveryMethodFactory], see error log for details 
Fri Feb 19 11:49:09 CET 2016:ERROR:An error occurred [com.eviware.soapui.plugins.auto.factories.AutoImportMethodFactory], see error log for details 
Fri Feb 19 11:49:09 CET 2016:INFO:4 plugins loaded in 1529 ms 
Fri Feb 19 11:49:09 CET 2016:INFO:All plugins loaded 
Fri Feb 19 11:49:09 CET 2016:INFO:Loading workspace from [/Users/jakubriedl/default-soapui-workspace.xml] 
Fri Feb 19 11:49:09 CET 2016:INFO:Loaded project from [file:/Users/jakubriedl/Desktop/xsd/A4Res-soapui-project.xml] 
Fri Feb 19 11:49:09 CET 2016:INFO:Defaulting to native L&F for Mac OS X 
Fri Feb 19 11:49:10 CET 2016:INFO:Used java version: 1.7.0_55 
Scheduling garbage collection every 60 seconds 
The cajo server is running on localhost:1198/soapuiIntegration 
Fri Feb 19 11:49:48 CET 2016:DEBUG:Attempt 1 to execute request 
Fri Feb 19 11:49:48 CET 2016:DEBUG:Sending request: POST /terminal HTTP/1.1 
Fri Feb 19 11:49:48 CET 2016:DEBUG:I/O error closing connection 
    javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure 
    at sun.security.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1476) 
    at sun.security.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1488) 
    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:70) 
    at org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:131) 
    at org.apache.http.impl.io.AbstractSessionOutputBuffer.flush(AbstractSessionOutputBuffer.java:138) 
    at org.apache.http.impl.conn.LoggingSessionOutputBuffer.flush(LoggingSessionOutputBuffer.java:95) 
    at org.apache.http.impl.AbstractHttpClientConnection.doFlush(AbstractHttpClientConnection.java:270) 
    at org.apache.http.impl.SocketHttpClientConnection.close(SocketHttpClientConnection.java:245) 
    at org.apache.http.impl.conn.DefaultClientConnection.close(DefaultClientConnection.java:164) 
    at org.apache.http.impl.conn.AbstractPooledConnAdapter.close(AbstractPooledConnAdapter.java:152) 
    at org.apache.http.protocol.HttpRequestExecutor.closeConnection(HttpRequestExecutor.java:142) 
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:129) 
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633) 
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454) 
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820) 
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754) 
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.execute(HttpClientSupport.java:233) 
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport.execute(HttpClientSupport.java:323) 
    at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.submitRequest(HttpClientRequestTransport.java:290) 
    at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:220) 
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:119) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at java.lang.Thread.run(Thread.java:745) 
    Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure 
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) 
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154) 
    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1959) 
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1077) 
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312) 
    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:702) 
    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122) 
    at org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:131) 
    at org.apache.http.impl.io.AbstractSessionOutputBuffer.flush(AbstractSessionOutputBuffer.java:138) 
    at org.apache.http.impl.conn.LoggingSessionOutputBuffer.flush(LoggingSessionOutputBuffer.java:95) 
    at org.apache.http.impl.io.ContentLengthOutputStream.flush(ContentLengthOutputStream.java:102) 
    at org.apache.http.entity.ByteArrayEntity.writeTo(ByteArrayEntity.java:69) 
    at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96) 
    at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108) 
    at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:120) 
    at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:263) 
    at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:227) 
    at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:255) 
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpRequestExecutor.doSendRequest(HttpClientSupport.java:119) 
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123) 
    ... 14 more 
Fri Feb 19 11:49:48 CET 2016:DEBUG:Closing the connection. 
Fri Feb 19 11:49:48 CET 2016:DEBUG:Connection closed 
Fri Feb 19 11:49:48 CET 2016:DEBUG:Connection shut down 
Fri Feb 19 11:49:48 CET 2016:ERROR:Exception in request: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure 
Fri Feb 19 11:49:48 CET 2016:ERROR:An error occurred [Received fatal alert: handshake_failure], see error log for details 
Fri Feb 19 11:49:49 CET 2016:INFO:Error getting response for [BasicHttpBinding_IPlanky.Login:Request 1]; javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure 
+0

看看這個https://siking.wordpress.com/2016/02/18/another-way-to-fix-sslhandshakeexception-in-soapui/ – SiKing

+0

這沒有幫助。同樣的錯誤和在SoapUI - >系統屬性我發現java.runtime.version = 1.8.0_74-b02這是最新的 –

+0

那麼http://stackoverflow.com/q/6353849/3124333? – SiKing

回答

0

客戶端得到一個出現SSLHandshakeException同時調用API網關的最常見的原因是客戶端不支持服務器名稱指示(SNI)。 API網關需要SNI,而一些較舊的http/https客戶端庫不支持它。大多數基於Java的https客戶端的最新版本支持SNI。嘗試將您的https客戶端庫更新到最新版本。

+0

感謝您的提示,但我有最新的SoapUI(5.2.1)和Java(1.8.0_74) –

+0

@JakubRiedl MikeD所談論的庫實際上是在$ SOAPUI_HOME/lib/httpclient - *。jar中。 ..這是相當過時的。您可以嘗試用http://search.maven.org/#artifactdetails|org.apache.httpcomponents|httpclient|4.5.1|jar中的jar替換它,但是您也必須替換所有依賴項。 – SiKing

+0

@SiKing它看起來像可能的方式,因爲有一個httpclient-4.1.1.jar。但我不熟悉JAVA和maven。你能告訴我怎樣去更新圖書館嗎?當我試圖只替換依賴項中列出的所有文件時,我在日誌中看到很多錯誤,如nullPointerException等等。 –

0

從這個線程設置:smartbear forum topic for TLS V1.2

,並用於加入到vmoptions文件(soapUI的bin目錄下)這個具體建議:

-Dsoapui.https.protocols=SSLv3,TLSv1.2 

而且已訪問AWS與apikey精細,soapUI的V5.3.0

0

升級到SoupUI 5.3.0爲我解決了這個問題。