okhttp3

HTTP/2 protocol not working with okhttp

Deadly 提交于 2020-01-01 08:26:07
问题 I am using Retrofit 1.9 with okhttp 2.4.0. So far we have SPDY protocol disabled on server side (I checked it by this ). And enabled protocol on server side is HTTP/2 (I checked it by this). So I was thinking that okhttp will try to make an api call using HTTP/2 (latest one protocol) but it's using HTTP/1.1 on android device 4.2.2 samsung S4 - D/Retrofit : OkHttp-Selected-Protocol: http/1.1 Someone told me that android device doesn't support SPDY until 5.0 (I don't have any proof), so that

HTTP/2 protocol not working with okhttp

孤者浪人 提交于 2020-01-01 08:26:02
问题 I am using Retrofit 1.9 with okhttp 2.4.0. So far we have SPDY protocol disabled on server side (I checked it by this ). And enabled protocol on server side is HTTP/2 (I checked it by this). So I was thinking that okhttp will try to make an api call using HTTP/2 (latest one protocol) but it's using HTTP/1.1 on android device 4.2.2 samsung S4 - D/Retrofit : OkHttp-Selected-Protocol: http/1.1 Someone told me that android device doesn't support SPDY until 5.0 (I don't have any proof), so that

OkHttp SSLHandshakeException SSL handshake aborted Failure in SSL library, a protocol error

丶灬走出姿态 提交于 2020-01-01 04:57:18
问题 04-23 17:17:38.434 21599-21956/ D/NativeCrypto: ssl=0x0 NativeCrypto_SSL_interrupt 04-23 17:17:38.435 21599-21956/ D/OkHttp: <-- HTTP FAILED: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x635d8808: Failure in SSL library, usually a protocol error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x5e6c46fd:0x00000000) Android lower version devices (4.1 - 4.4) gives SSL

Retrofit 2 OkHttpClient caching not working

妖精的绣舞 提交于 2019-12-25 18:53:52
问题 So here's the problem, I'm trying to implement caching for my app and I followed this tutorial Android: Cache network requests for offline access with Retrofit2 and OkHTTP3 to do it. Sadly, cached responses are not showing up when there is no internet connection, instead the Toast.makeText(getContext(), getContext().getResources().getString(R.string.error_failed_to_load_posts), Toast.LENGTH_SHORT).show(); gets executed. So can anyone tell me what I am doing wrong? Or guide me to get an answer

Android: Unable to handle UnknownHostException [with Retrofit 2, okhttp3, rxandroid 2]

大憨熊 提交于 2019-12-25 17:01:59
问题 I've got an Android app which has been in production for some time. I've received a fatal report to Firebase (log is below) but it's not clear to me how to avoid it next time. I've found similar stack trace here java.net.UnknownHostException Unable to resolve host "accounts.google.com": No address associated with hostname while inserting rows in bigquery but they were able resolved it with: <uses-permission android:name="android.permission.INTERNET" /> But that's not my case. For network

Android: Unable to handle UnknownHostException [with Retrofit 2, okhttp3, rxandroid 2]

此生再无相见时 提交于 2019-12-25 17:01:14
问题 I've got an Android app which has been in production for some time. I've received a fatal report to Firebase (log is below) but it's not clear to me how to avoid it next time. I've found similar stack trace here java.net.UnknownHostException Unable to resolve host "accounts.google.com": No address associated with hostname while inserting rows in bigquery but they were able resolved it with: <uses-permission android:name="android.permission.INTERNET" /> But that's not my case. For network

javax.net.ssl.SSLPeerUnverifiedException Error in retrieving Session key from Skyscanner API - Android

谁说胖子不能爱 提交于 2019-12-25 07:59:44
问题 I have been working on Sky scanner API to retrieve the flight fares and other details in android. I'm using the Retrofit2 for network calls. The problem is getting error in retrieving the Session key Error javax.net.ssl.SSLPeerUnverifiedException: Hostname partners.api.skyscanner.net not verified:certificate: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=DN:CN=api.skyscanner.net,OU=Infrastructure,O=Skyscanner Ltd,L=London,ST=London,C=GB APIClient public static Retrofit getRetrofit() { if

Retrofit with OkHTTP not set Content-Type with @FormUrlEncoded

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 03:36:08
问题 I'm trying to implement auth via x-www-form-urlencoded with Retrofit 2 on Android but faced a problem, that Header Content-Type not set with @FormUrlEncoded annotation, as well as I'm trying to set it manually, but when I'm setting it with a typo like Cotent-Type it works correctly and I can see it in headers. Retrofit version: 2.4.0 So my question: why @FormUrlEncoded not set a content type as well as @Header annotation or what can remove it from headers. My request: @FormUrlEncoded @POST(

Send Json to server (nginx) as String - retrofit 2

懵懂的女人 提交于 2019-12-24 20:42:19
问题 I am connecting to web service with last version retrofit but get me bellow error : okhttp3.internal.http2.StreamResetException: stream was reset: PROTOCOL_ERROR Is this error okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL for huge string ? or for **nginx** of server ? My code is like bellow : try { // Create a trust manager that does not validate certificate chains final TrustManager[] trustAllCerts = new TrustManager[]{ new X509TrustManager() { @Override public void

Does OkHttp support HTTP/2 server push?

两盒软妹~` 提交于 2019-12-24 08:34:29
问题 I am developing an Android video streaming application using the OkHttp library and HTTP/2. I am investigating the possibility of using the server push functionality of the HTTP/2 protocol, but I am not sure whether OkHttp supports it or not. I have a basic server implementation to test HTTP/2 push, which works without problems on the chrome browser (i.e., pushed content is stored in the cache and retrieved from the cache by the browser). When I use the Android application with the OkHttp