我遇到了问题。
我使用Titanium SDK 5.1.1.GA和Play框架2.3。*与Java 1.8。
问题是当我通过不良网络(例如3G)在一个多部分POST请求中上传多个文件时我收到了该错误:
[ERROR] : TiHTTPClient: (TiHttpClient-9) [60597,61749] HTTP Error (javax.net.ssl.SSLHandshakeException): javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x7b93c2a0: Failure in SSL library, usually a protocol error
[ERROR] : TiHTTPClient: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x743667e8:0x00000000)
[ERROR] : TiHTTPClient: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x7b93c2a0: Failure in SSL library, usually a protocol error
[ERROR] : TiHTTPClient: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x743667e8:0x00000000)
[ERROR] : TiHTTPClient: at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:469)
[ERROR] : TiHTTPClient: at com.android.okhttp.Connection.upgradeToTls(Connection.java:1014)
[ERROR] : TiHTTPClient: at com.android.okhttp.Connection.connect(Connection.java:955)
[ERROR] : TiHTTPClient: at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:411)
[ERROR] : TiHTTPClient: at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:343)
[ERROR] : TiHTTPClient: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:289)
[ERROR] : TiHTTPClient: at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)
[ERROR] : TiHTTPClient: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
[ERROR] : TiHTTPClient: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getHeaderField(HttpURLConnectionImpl.java:143)
[ERROR] : TiHTTPClient: at java.net.URLConnection.getHeaderFieldInt(URLConnection.java:544)
[ERROR] : TiHTTPClient: at java.net.URLConnection.getContentLength(URLConnection.java:316)
[ERROR] : TiHTTPClient: at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getContentLength(HttpsURLConnectionImpl.java:182)
[ERROR] : TiHTTPClient: at ti.modules.titanium.network.TiHTTPClient.handleResponse(TiHTTPClient.java:158)
[ERROR] : TiHTTPClient: at ti.modules.titanium.network.TiHTTPClient.access$1200(TiHTTPClient.java:84)
[ERROR] : TiHTTPClient: at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1198)
[ERROR] : TiHTTPClient: at java.lang.Thread.run(Thread.java:841)
[ERROR] : TiHTTPClient: Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x7b93c2a0: Failure in SSL library, usually a protocol error
[ERROR] : TiHTTPClient: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x743667e8: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:426)
[ERROR] : TiHTTPClient: ... 15 more
我已经在Android 4.1,4.4.2上使用不同的设备对其进行了测试,并且在上传总大小超过5mb的文件时,根据我收到该错误的设备进行了测试。 如果我使用良好的WiFi连接或尝试上传总大小小于5 MB的文件,那么一切都很好。
文件总大小取决于手机。手机比文件大小越大越好。
此外,如果我通过WiFi从手机A连接到手机B,而手机B有3g连接到互联网,那么我也得到了这个错误,但如果我使用代理服务器模拟连接错误而不会出现错误