小编dpe*_*ers的帖子

OkHttp Android 流已重置:HTTP_1_1_REQUIRED

我们正在开发一个 Android 应用程序,它应该使用 Http/2 连接到我们的 Azure 应用服务。在 Azure 应用服务上,我们使用以下博客文章中的步骤启用了 Http/2:https : //blogs.msdn.microsoft.com/appserviceteam/2018/04/13/annoucing-http2-support-in-azure -应用服务/

我们的请求使用 Mutual SSL 进行保护,因此应用程序必须发送它的客户端证书。

当我们尝试使用 OkHttp 执行对我们的应用服务的调用时,我们总是收到以下错误和堆栈跟踪。当我们尝试使用相同的 Android 代码调用 twitter api 时,这是有效的。

有没有人知道如何解决这个问题?

我们使用的是 OkHttp 3.10.0 版。

堆栈跟踪:

    06-08 15:54:00.173 31318-31351/be.wgkovl.evdt W/be.wgkovl.evdt.utils.BaseService:流被重置:HTTP_1_1_REQUIREDokhttp3.internal.http2.StreamResetException:流被重置:HTTP_1RED_1
                在 okhttp3.internal.http2.Http2Stream.takeResponseHeaders(Http2Stream.java:153) ~[na:0.0]
                在 okhttp3.internal.http2.Http2Codec.readResponseHeaders(Http2Codec.java:125) ~[na:0.0]
                在 okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88) ~[na:0.0]
                在 okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) ~[na:0.0]
                在 okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45) ~[na:0.0]
                在 okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) ~[na:0.0]
                在 okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) ~[na:0.0]
                在 okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93) ~[na:0.0]
                在 okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) ~[na:0.0]
                在 okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) ~[na:0.0]
                在 okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) ~[na:0.0]
                在 okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) ~[na:0.0]
                在 okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126) ~[na:0.0]
                在 okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) ~[na:0.0]
                在 okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) …

android azure http2 azure-app-service-plans okhttp3

2
推荐指数
2
解决办法
3671
查看次数

标签 统计

android ×1

azure ×1

azure-app-service-plans ×1

http2 ×1

okhttp3 ×1