Android SSL握手使用HTTPS连接到Web服务时失败

时间:2016-02-26 19:47:29

标签: android ssl sslhandshakeexception boringssl

我的Android应用程序连接到我服务器上的Web服务。昨天一切正常,但今天我收到了错误。

我没有对网络服务或应用程序进行任何更改。我怀疑我的服务器出了问题,但不知道从哪里开始。

我在Android 5和Android 6设备上都进行了测试。

这是错误:

HTTPClient: (TiHttpClient-3) [1136,1136] HTTP Error (javax.net.ssl.SSLHandshakeException): Handshake failed
[ERROR] :  TiHTTPClient: javax.net.ssl.SSLHandshakeException: Handshake failed
[ERROR] :  TiHTTPClient:    at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:396)
[ERROR] :  TiHTTPClient:    at com.android.okhttp.internal.http.SocketConnector.connectTls(SocketConnector.java:103)
[ERROR] :  TiHTTPClient:    at com.android.okhttp.Connection.connect(Connection.java:143)
[ERROR] :  TiHTTPClient:    at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:185)
[ERROR] :  TiHTTPClient:    at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:128)
[ERROR] :  TiHTTPClient:    at com.android.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:341)
[ERROR] :  TiHTTPClient:    at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:330)
[ERROR] :  TiHTTPClient:    at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:248)
[ERROR] :  TiHTTPClient:    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:437)
[ERROR] :  TiHTTPClient:    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388)
[ERROR] :  TiHTTPClient:    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getHeaders(HttpURLConnectionImpl.java:150)
[ERROR] :  TiHTTPClient:    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getHeaderField(HttpURLConnectionImpl.java:194)
[ERROR] :  TiHTTPClient:    at java.net.URLConnection.getHeaderFieldInt(URLConnection.java:543)
[ERROR] :  TiHTTPClient:    at java.net.URLConnection.getContentLength(URLConnection.java:315)
[ERROR] :  TiHTTPClient:    at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getContentLength(DelegatingHttpsURLConnection.java:146)
[ERROR] :  TiHTTPClient:    at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getContentLength(HttpsURLConnectionImpl.java)
[ERROR] :  TiHTTPClient:    at ti.modules.titanium.network.TiHTTPClient.handleResponse(TiHTTPClient.java:159)
[ERROR] :  TiHTTPClient:    at ti.modules.titanium.network.TiHTTPClient.access$1200(TiHTTPClient.java:85)
[ERROR] :  TiHTTPClient:    at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1207)
[ERROR] :  TiHTTPClient:    at java.lang.Thread.run(Thread.java:818)
[ERROR] :  TiHTTPClient:    Suppressed: javax.net.ssl.SSLHandshakeException: Handshake failed
[ERROR] :  TiHTTPClient:        ... 20 more
[ERROR] :  TiHTTPClient:        Suppressed: javax.net.ssl.SSLHandshakeException: Handshake failed
[ERROR] :  TiHTTPClient:            ... 20 more
[ERROR] :  TiHTTPClient:        Caused by: javax.net.ssl.SSLProtocolException: SSL handshake terminated: ssl=0xaef13100: Failure in SSL library, usually a protocol error
[ERROR] :  TiHTTPClient: error:100c5410:SSL routines:ssl3_read_bytes:SSLV3_ALERT_HANDSHAKE_FAILURE (external/boringssl/src/ssl/s3_pkt.c:972 0x9defc240:0x00000001)
[ERROR] :  TiHTTPClient: error:100c009f:SSL routines:ssl3_get_server_hello:HANDSHAKE_FAILURE_ON_CLIENT_HELLO
[ERROR] :  TiHTTPClient:            at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
[ERROR] :  TiHTTPClient:            at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:324)
[ERROR] :  TiHTTPClient:            ... 19 more
[ERROR] :  TiHTTPClient:    Caused by: javax.net.ssl.SSLProtocolException: SSL handshake terminated: ssl=0xaef13100: Failure in SSL library, usually a protocol error
[ERROR] :  TiHTTPClient: error:100c5410:SSL routines:ssl3_read_bytes:SSLV3_ALERT_HANDSHAKE_FAILURE (external/boringssl/src/ssl/s3_pkt.c:972 0x9defc240:0x00000001)
[ERROR] :  TiHTTPClient: error:100c009f:SSL routines:ssl3_get_server_hello:HANDSHAKE_FAILURE_ON_CLIENT_HELLO (external/boringssl/src/ssl/s3_clnt.c:750 0xab1e350f:0x00000000)
[ERROR] :  TiHTTPClient:        at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
[ERROR] :  TiHTTPClient:        at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:324)
[ERROR] :  TiHTTPClient:        ... 19 more
[ERROR] :  TiHTTPClient: Caused by: javax.net.ssl.SSLProtocolException: SSL handshake terminated: ssl=0xaef13100: Failure in SSL library, usually a protocol error
[ERROR] :  TiHTTPClient: error:100c5410:SSL routines:ssl3_read_bytes:SSLV3_ALERT_HANDSHAKE_FAILURE (external/boringssl/src/ssl/s3_pkt.c:972 0x9defc240:0x00000001)
[ERROR] :  TiHTTPClient: error:100c009f:SSL routines:ssl3_get_server_hello:HANDSHAKE_FAILURE_ON_CLIENT_HELLO (external/boringssl/src/ssl/s3_clnt.c:750 0xab1e350f:0x00000000)
[ERROR] :  TiHTTPClient:    at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
[ERROR] :  TiHTTPClient:    at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:324)
[ERROR] :  TiHTTPClient:    ... 19 more

非常感谢任何指针。感谢。

1 个答案:

答案 0 :(得分:6)

您应该检查证书是否有问题 您可以在此处找到更多信息http://developer.android.com/training/articles/security-ssl.html#UnknownCa

enter image description here