Я получаю исключение при ожидании ответа от библиотеки okhttp в Android 8.0 и Android 7.x, он работает нормально.
Я использую
compileOnly com.squareup.okhttp:okhttp:2.7.5
Исходный кодфрагмент:
final RequestBody requestBody = RequestBody.create(MediaType.parse(HttpConstants.CONTENT_TYPE_JSON), body);
final Request.Builder requestBuilder =
new Request.Builder().post(requestBody).url(completeUrl.toString()).headers(getDefaultHeaders());
final Request request = requestBuilder.build();
httpClient.setConnectTimeout(60, TimeUnit.SECONDS);
httpClient.setReadTimeout(60, TimeUnit.SECONDS);
httpClient.setWriteTimeout(60, TimeUnit.SECONDS);
final Response response = httpClient.newCall(request).execute();
ниже приведено исключение, которое я получил
(Java_com_android_org_conscrypt_NativeCrypto_SSL_1read__JLjava_io_FileDescriptor_2Lcom_android_org_conscrypt_NativeCrypto_00024SSLHandshakeCallbacks_2_3BIII+268)
at com.android.org.conscrypt.NativeCrypto.SSL_read(Native method)
at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:766)
- locked <0x0a8dbea5> (a java.lang.Object)
at okio.Okio$2.read(Okio.java:139)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:306)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:300)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:196)
at com.squareup.okhttp.internal.http.Http1xStream.readResponse(Http1xStream.java:186)
at com.squareup.okhttp.internal.http.Http1xStream.readResponseHeaders(Http1xStream.java:127)
at com.squareup.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:737)
at com.squareup.okhttp.internal.http.HttpEngine.access$200(HttpEngine.java:87)
at com.squareup.okhttp.internal.http.HttpEngine$NetworkInterceptorChain.proceed(HttpEngine.java:722)
at com.squareup.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:576)
at com.squareup.okhttp.Call.getResponse(Call.java:287)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:243)
at com.gemalto.odc.common.http.OkHttpService$RetryingOkHttpInterceptor.intercept(OkHttpService.java:230)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:232)
at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:205)
at com.squareup.okhttp.Call.execute(Call.java:80)
at com.gemalto.odc.common.http.OkHttpService.sendRequest(OkHttpService.java:95)
at com.gemalto.odc.profileassistant.internal.job.HttpJob.execute(HttpJob.java:74)
.
.
.
.
.