java.net.SocketTimeoutException thrown only on some Android devices - android

I am trying to upload a JPEG image file from an Android device. I am using the square/okhttp library for creating a request. I am facing this issue on the Lenovo Yoga tablet, that when I am trying to upload the image, it gets the below exception. But when I run the same code on Samsung Galaxy Tab 10", it all works fine and the image gets uploaded successfully.
The camera captures the image and stores it at /storage/emulated/0/ from where the app will pick up the image and try to upload it. I have a service running in the background that does the upload.
final MediaType MEDIA_TYPE_IMAGE_JPEG = MediaType.parse("image/jpeg");
File file = new File(path);
Request request = new Request.Builder()
.url(baseUrl)
.addHeader("timestamp", map.get("timestamp"))
.addHeader("Content-Type", map.get("Content-Type"))
.post(RequestBody.create(MEDIA_TYPE_IMAGE_JPEG, file))
.build();
OkHttpClient client = new OkHttpClient();
Response response = client.newCall(request).execute();
Exception:
java.net.SocketTimeoutException: timeout
11-27 15:37:06.394 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2
Stream.java:593)
11-27 15:37:06.394 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.java:601)
11-27 15:37:06.394 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http2.Http2Stream.takeResponseHeaders(Http2Stream.java:146)
11-27 15:37:06.394 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http2.Http2Codec.readResponseHeaders(Http2Codec.java:125)
11-27 15:37:06.394 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88)
11-27 15:37:06.394 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
11-27 15:37:06.394 1770-2339/commyapp.app.debug
W/System.err: at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
11-27 15:37:06.394 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
11-27 15:37:06.394 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
11-27 15:37:06.395 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
11-27 15:37:06.395 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
11-27 15:37:06.395 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
11-27 15:37:06.395 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
11-27 15:37:06.395 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
11-27 15:37:06.395 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
11-27 15:37:06.395 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
11-27 15:37:06.395 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
11-27 15:37:06.395 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
11-27 15:37:06.395 1770-2339/com.myapp.app.debug
W/System.err: at okhttp3.RealCall.execute(RealCall.java:77)

You have to increase the read/write timeout on the server end. A temporary workaround for Android would be increasing the default timeout for OkHttp3 client:
OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(60, TimeUnit.SECONDS)
.writeTimeout(120, TimeUnit.SECONDS)
.readTimeout(60, TimeUnit.SECONDS)
.build();

Related

Android app on Chromebook throwing dlopen failed: "/lib/x86/libwebviewchromium.so" .dynamic section header was not found

I am getting following error from users who have install my app on Intel Braswell Chromebook. I have searched for similar issue but seems like no one faced it. How do I go about debugging and solving this one?
android.util.AndroidRuntimeException: java.lang.reflect.InvocationTargetException
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:270)
at android.webkit.CookieManager.getInstance(CookieManager.java:40)
at //my app redacted
at //my app redacted
at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.java:59)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:84)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at //my app redacted
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:250)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:201)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Method.java:-2)
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:265)
at android.webkit.CookieManager.getInstance(CookieManager.java:40)
at //my app redacted
at //my app redacted
at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.java:59)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:84)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at //my app redacted
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:250)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:201)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: at: errorCode=2
at org.chromium.base.library_loader.LibraryLoader.a(PG:54)
at org.chromium.base.library_loader.LibraryLoader.a(PG:11)
at org.chromium.android_webview.AwBrowserProcess.a(PG:15)
at com.android.webview.chromium.WebViewChromiumFactoryProvider.a(PG:79)
at com.android.webview.chromium.WebViewChromiumFactoryProvider.<init>(PG:12)
at com.android.webview.chromium.WebViewChromiumFactoryProviderForP.<init>(PG:1)
at com.android.webview.chromium.WebViewChromiumFactoryProviderForP.create(PG:1)
at java.lang.reflect.Method.invoke(Method.java:-2)
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:265)
at android.webkit.CookieManager.getInstance(CookieManager.java:40)
at //my app redacted
at //my app redacted
at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.java:59)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:84)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at //my app redacted
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:250)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:201)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.google.android.webview-czSKGqLMd8tXGZBl2CdlZQ==/lib/x86/libwebviewchromium.so" .dynamic section header was not found
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1669)
at org.chromium.base.library_loader.LibraryLoader.a(PG:46)
at org.chromium.base.library_loader.LibraryLoader.a(PG:11)
at org.chromium.android_webview.AwBrowserProcess.a(PG:15)
at com.android.webview.chromium.WebViewChromiumFactoryProvider.a(PG:79)
at com.android.webview.chromium.WebViewChromiumFactoryProvider.<init>(PG:12)
at com.android.webview.chromium.WebViewChromiumFactoryProviderForP.<init>(PG:1)
at com.android.webview.chromium.WebViewChromiumFactoryProviderForP.create(PG:1)
at java.lang.reflect.Method.invoke(Method.java:-2)
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:265)
at android.webkit.CookieManager.getInstance(CookieManager.java:40)
at //my app redacted
at //my app redacted
at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.java:59)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:84)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at //my app redacted
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:250)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:201)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)

OpenStream throws IOException in AsyncTask

Context:
I'm developing an Android weather application in Java for a course. This application uses asynctask in order to get from OpenWeather's API the temperature of a city. The API returns a JSON with weather information through an URL like this:
http://api.openweathermap.org/data/2.5/weather?q={city name}&appid={key}
APPID is a key associated to an account in OpenWeather. Here is a JSON example for Berlin city:
{"coord":{"lon":13.39,"lat":52.52},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"base":"stations","main":{"temp":8.49,"pressure":1035,"humidity":61,"temp_min":8,"temp_max":9},"visibility":10000,"wind":{"speed":6.7,"deg":120},"clouds":{"all":0},"dt":1542369000,"sys":{"type":1,"id":4892,"message":0.0027,"country":"DE","sunrise":1542349837,"sunset":1542381079},"id":2950159,"name":"Berlin","cod":200}
If the city doesn't exists, the API returns a JSON with error 404. The next one is a JSON example for the nonexistent city Berlina.
{"cod":"404","message":"city not found"}
I get the JSON with Asynctask. In doInBackground() method, I call the following line in order to get an inputStream:
InputStream inputStream = new URL(url).openStream();
Then, I parse the JSON in postOnExecute() and show the temperature information with a Toast.
My question:
The code works fine with Berlin, but openStream throws IOException for Berlina. The URL exists and have JSON data, as I explained. So, what could be the reasons for this Exception? Could it be a connection problem?
Edit with Logcat
This is the exception detail:
11-27 00:01:34.151 3152-3346/com.androidapps.user.weatherapp D/IOException: http://api.openweathermap.org/data/2.5/weather?q=Berlina&units=metric&appid=d32068a850405b593a87d410fcc50a4f
11-27 00:01:34.151 3152-3346/com.androidapps.user.weatherapp W/System.err: java.io.FileNotFoundException: http://api.openweathermap.org/data/2.5/weather?q=Berlina&units=metric&appid=d32068a850405b593a87d410fcc50a4f
11-27 00:01:34.152 3152-3346/com.androidapps.user.weatherapp W/System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:206)
11-27 00:01:34.152 3152-3346/com.androidapps.user.weatherapp W/System.err: at java.net.URL.openStream(URL.java:470)
11-27 00:01:34.152 3152-3346/com.androidapps.user.weatherapp W/System.err: at com.androidapps.user.weatherapp.MainActivity$GetJSONOpenWeather.doInBackground(MainActivity.java:219)
11-27 00:01:34.152 3152-3346/com.androidapps.user.weatherapp W/System.err: at com.androidapps.user.weatherapp.MainActivity$GetJSONOpenWeather.doInBackground(MainActivity.java:204)
11-27 00:01:34.152 3152-3346/com.androidapps.user.weatherapp W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:292)
11-27 00:01:34.152 3152-3346/com.androidapps.user.weatherapp W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
11-27 00:01:34.152 3152-3346/com.androidapps.user.weatherapp W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
11-27 00:01:34.152 3152-3346/com.androidapps.user.weatherapp W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
11-27 00:01:34.152 3152-3346/com.androidapps.user.weatherapp W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
11-27 00:01:34.152 3152-3346/com.androidapps.user.weatherapp W/System.err: at java.lang.Thread.run(Thread.java:818)
11-27 00:01:34.192 3152-3180/com.androidapps.user.weatherapp D/EGL_emulation: eglMakeCurrent: 0xb42b9b20: ver 2 0
11-27 00:01:34.227 3152-3152/com.androidapps.user.weatherapp D/JSONObjetc: End of input at character 0 of

Retrofit2 async task error even when using enqueue

so i'm getting a crash on this app i'm building every-time i try to upload a photo to the server. heres the error message
android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1303)
at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:86)
at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:74)
at java.net.InetAddress.getAllByName(InetAddress.java:752)
at okhttp3.Dns$1.lookup(Dns.java:40)
at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:185)
at okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.java:149)
at okhttp3.internal.connection.RouteSelector.next(RouteSelector.java:84)
at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:214)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:212)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
at okhttp3.RealCall.execute(RealCall.java:77)
at retrofit2.OkHttpCall.execute(OkHttpCall.java:180)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall.execute(ExecutorCallAdapterFactory.java:91)
at com.quantamfig.docuflow.SubmitActivity.postValuesRetro(SubmitActivity.java:274)
at com.quantamfig.docuflow.SubmitActivity$2.onClick(SubmitActivity.java:206)
at android.view.View.performClick(View.java:5647)
at android.view.View$PerformClick.run(View.java:22465)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6228)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
as you can see, im getting a NetworkonMainThreadExeption error () even though im running the code asynchronously using enqueue.Please someone help me figure this out
so the problem was, i was trying to log a call Object method(callObj.execute) outside the enqeue and therefore on the main thread. i took it out and it worked.

How to support TLS 1.0 with okhttp in android 4.4 to 5.0

I am using the source code to connect the website with https://
I am using this code:
client = new OkHttpClient.Builder().connectTimeout(30, TimeUnit.SECONDS).writeTimeout(3600, TimeUnit.SECONDS).readTimeout(3600, TimeUnit.SECONDS).build();
but it will send back this result:
W: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xb8b214a0: 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:741 0x84dcb770:0x00000000)
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:448)
at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:302)
at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:270)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:162)
at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
I am using the Android 4.4 with okhttp 3.10.0

SSLHandshakeException: Connection closed by peer

I have a simple code and there is an exception coming, can't figure out why?
My code:
Document document= Jsoup.connect("https://kolkatatrafficpolice.net/").get();
Stack trace:
javax.net.ssl.SSLHandshakeException: Connection closed by peer
W/System.err: at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
W/System.err: at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:357)
W/System.err: at com.android.okhttp.Connection.connectTls(Connection.java:235)
W/System.err: at com.android.okhttp.Connection.connectSocket(Connection.java:199)
W/System.err: at com.android.okhttp.Connection.connect(Connection.java:172)
W/System.err: at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:367)
W/System.err: at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:130)
W/System.err: at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:330)
W/System.err: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:247)
W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:457)
W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:126)
W/System.err: at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.connect(DelegatingHttpsURLConnection.java:89)
W/System.err: at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java)
W/System.err: at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:571)
W/System.err: at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:548)
W/System.err: at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:235)
W/System.err: at org.jsoup.helper.HttpConnection.get(HttpConnection.java:224)
W/System.err: at com.pritesh.trafficviolation.GetHtml.doInBackground(MainActivity.java:29)
That server is using an unrecognized certificate authority.
If this is your server, and you are intentionally doing this (e.g., this is a self-signed certificate), you would need to configure JSoup/OkHttp to use that self-signed certificate.
Otherwise, your problems lie with the server.

Categories

Resources