我们有一个现有的Android应用程序,该应用程序使用Retrofit连接到服务器并发送和接收JSON。由于将设备更新为Android 4.4.4,因此在尝试连接时出现以下错误:
D/Retrofit(8004): javax.net.ssl.SSLException: Read error: ssl=0x768c5c40: I/O error during system call, Connection reset by peer D/Retrofit(8004): at com.android.org.conscrypt.NativeCrypto.SSL_read(Native Method) D/Retrofit(8004): at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:689) D/Retrofit(8004): at okio.Okio$2.read(Okio.java:136) D/Retrofit(8004): at okio.AsyncTimeout$2.read(AsyncTimeout.java:211) D/Retrofit(8004): at okio.RealBufferedSource.indexOf(RealBufferedSource.java:244) D/Retrofit(8004): at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:191) D/Retrofit(8004): at com.squareup.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:189) D/Retrofit(8004): at com.squareup.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:101) D/Retrofit(8004): at com.squareup.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:676) D/Retrofit(8004): at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:426) D/Retrofit(8004): at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:371) D/Retrofit(8004): at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:466) D/Retrofit(8004): at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105) D/Retrofit(8004): at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25) D/Retrofit(8004): at retrofit.client.UrlConnectionClient.readResponse(UrlConnectionClient.java:73) D/Retrofit(8004): at retrofit.client.UrlConnectionClient.execute(UrlConnectionClient.java:38) D/Retrofit(8004): at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:321) D/Retrofit(8004): at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220) D/Retrofit(8004): at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278) D/Retrofit(8004): at retrofit.CallbackRunnable.run(CallbackRunnable.java:42) D/Retrofit(8004): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) D/Retrofit(8004): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) D/Retrofit(8004): at retrofit.Platform$Android$2$1.run(Platform.java:142) D/Retrofit(8004): at java.lang.Thread.run(Thread.java:841)
我已经更新到Retrofit / OkHTTP和Okio的最新版本,但是错误仍然存在。我猜想这与Android 4.4.4中的OpenSSL补丁有关,但是我找不到此错误的解决方案。
有没有其他人遇到过这个问题,并且找到了解决办法?
谢谢
丰富