SoapUI连接到AWS API网关

时间:2016-02-19 14:24:42

标签: ssl soapui aws-lambda aws-api-gateway

我正在API网关后面的AWS Lambda(node.js)上构建小型SOAP API。我添加了带有可信证书的自定义域(COMODO RSA证书颁发机构),但是当我尝试来自SoapUI的任何请求(OSX上的v5.2.1)时,它失败了handshake_failure

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

我尝试使用公共部分证书创建密钥库并将其添加到 项目设置 - > WS-Security配置 - > Keystore和Truststores但它没有帮助。

我还试图添加几行到SoapUI / Contents / 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

3 个答案:

答案 0 :(得分:0)

客户端在调用API网关时获得SSLHandshakeException的最常见原因是客户端不支持服务器名称指示(SNI)。 API网关需要SNI,而一些较旧的http / https客户端库不支持它。大多数基于Java的https客户端的最新版本都支持SNI。尝试将您的https客户端库更新到最新版本。

答案 1 :(得分:0)

从此主题获取设置:smartbear forum topic for TLS V1.2

并将此特定建议添加到vmoptions文件(soapui bin目录)中:

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

在soapui v5.3.0

中使用apikey访问AWS

答案 2 :(得分:0)

升级到SoupUI 5.3.0为我解决了这个问题。