javax.net.ssl.SSLHandshakeException:连接被同级关闭

时间:2018-06-28 19:39:00

标签: java asp.net android-studio https ksoap2

我有一个使用ASP.Net Web服务的Android应用程序。

它不适用于Android 7,并产生以下错误:

javax.net.ssl.SSLHandshakeException:连接已被同级关闭

摘要代码为:

AllCertificatesAndHostsTruster.apply ();
HttpsTransportSE transport = new KeepAliveHttpsTransportSE (context.getResources (). GetString (R.string.server_local), 443, URL, timeoutGlobal);
transport.call (SOAP_ACTION, envelope);

AllCertificatesAndHostsTruster.apply()的来源:https://gist.github.com/gotev/6784c1303793c6ee9e56

有什么想法吗?从现在开始谢谢。

2 个答案:

答案 0 :(得分:0)

确保已从服务器端启用了TLS。

答案 1 :(得分:0)

您可能会丢失

-Dhttps.protocols=TLSv1.2

如果服务器上的证书不支持TLS1(这是Java 7的默认值),则JVM参数启用TLSv1.2

specification