我正在尝试发送HTTPS请求以发送Apple推送通知(APN)以使用SoapUI 5.2.1测试我的应用程序。我对SoapUI进行了以下配置更改,以支持TLS 1.2连接。
api.development.push.apple.com
-Dsun.security.ssl.allowUnsafeRenegotiation=true
-Dsoapui.https.protocols=TLSv1.2
-Dsoapui.https.ciphers=ECDHE-RSA-AES256-GCM-SHA384
如果我使用curl使用verbose(-vvv)发送推送通知,则协商会产生带有密码ECDHE-RSA-AES256-GCM-SHA384的TLS 1.2。因此,当与SoapUI建立连接时,Apple APN服务器应该接受协议和密码。
* Connected to api.development.push.apple.com (17.172.238.203) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ECDHE-RSA-AES256-GCM-SHA384
* successfully set certificate verify locations:
* CAfile: /usr/local/etc/openssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Request CERT (13):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS handshake, CERT verify (15):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
现在在SoapUI中创建一个HTTPS Post请求到https://api.development.push.apple.com/3/device/{device id}
我仍然收到错误ERROR:java.lang.IllegalArgumentException: Unsupported ciphersuite ECDHE-RSA-AES256-GCM-SHA384
使用Java 7 JSSE Cipher Suite名称TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
时仍然会收到不受支持的密码套件错误。
日志中没有详细信息..任何帮助/想法/想法/提示?
更新1
我使用集成Java 7的SoapUI 5.2.1 Mac OS X安装程序。 Java根据Java 7 documentation不支持TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384密码套件。
将SoapUI 5.2.1 Mac OS X安装程序替换为不包含Java的SoapUI 5.2.1 Mac OS X zip。我安装了Java 1.8.0_60,它支持必要的密码套件。 (参考here)
修改了soapui.sh脚本以包含必要的Java选项
if [ $SOAPUI_HOME != "" ]
then
JAVA_OPTS="$JAVA_OPTS -Dsoapui.ext.libraries=$SOAPUI_HOME/bin/ext"
JAVA_OPTS="$JAVA_OPTS -Dsoapui.ext.listeners=$SOAPUI_HOME/bin/listeners"
JAVA_OPTS="$JAVA_OPTS -Dsoapui.ext.actions=$SOAPUI_HOME/bin/actions"
JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$SOAPUI_HOME/bin"
JAVA_OPTS="$JAVA_OPTS -Dwsi.dir=$SOAPUI_HOME/wsi-test-tools"
JAVA_OPTS="-Dsun.security.ssl.allowUnsafeRenegotiation=true"
JAVA_OPTS="-Dsoapui.https.protocols=TLSv1.2"
JAVA_OPTS="-Dsoapui.https.ciphers=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384"
JAVA_OPTS="-Djavax.net.debug=ssl,handshake"
#uncomment to disable browser component
# JAVA_OPTS="$JAVA_OPTS -Dsoapui.browser.disabled=true"
fi
立即获取下一个错误ERROR:org.apache.http.client.ClientProtocolException
。
可能是与HTTP / 2协议相关的东西,SoapUI可能不支持。
更新2
正如@vzamanillo所建议的那样,Java 8默认使用TLS 1.2,因此可以删除附加的Java选项。 CipherSuite问题现已解决,错误;
ERROR:org.apache.http.client.ClientProtocolExceptionis
与SSL,TLS或密码套件无关的错误,但可能是SoapUI不支持HTTP / 2的问题。
答案 0 :(得分:3)
Java 7不支持TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384密码套件,因此将Java 8用于SoapUI 5.2.1。设置Java选项Dsoapui.https.protocols = TLSv1.2以强制TLSc1.2也不是必需的,因为这是Java 8的默认设置。