4,485 questions
0 votes
2 answers
100 views
java.lang.ClassNotFoundException: okio.Buffer when using OkHttp inside Eclipse plugin (OSGi)
I am developing an Eclipse plugin (OSGi environment) and trying to use OkHttp 4.11.0 to send HTTP requests. However, I get the following runtime error: java.lang.ClassNotFoundException: okio.Buffer ...
2 votes
0 answers
99 views
OkHttpClient Client not sending server-name extension in SSL Client handshake
I have a Springboot server with two ssl self signed certificates configured for different hostnames. One certificate assigned to hostname localhost. Another assigned as fallback, so any hostname other ...
0 votes
1 answer
63 views
Authenticated Socks5 With OkHttpClient
Been spending hours trying to get OkHttpClient to work with a proxy. My proxy supports socks5, https. I cannot get it to work on either. I've now spent hours trying different work arounds from years ...
3 votes
1 answer
418 views
Android project throws FileAnalysisException in onCreate method in Main Activity when adding OkHttp library
I've created an Empty Views Activity project in Android Studio, but as soon as I add the dependency in build.gradle.kts and try to launch the app, it throws an exception (see output). No code is ...
1 vote
1 answer
86 views
Do OkHttpClient instances created with newBuilder() from common client share the same pools?
According to the docs of OkHttpClient, it is better to use a single shared instance. In my case I need a client for HTTP requests and a client for WebSocket connections; both have different ...
0 votes
0 answers
65 views
How to initialize Android OkHttp cache interceptor config at app start without blocking the main thread (Hilt + Coroutines)?
I have a CacheCreation class that prepares config for an OkHttp interceptor. It’s created during DI on app launch, and we currently use runBlocking so the object graph is ready before the first ...
-1 votes
1 answer
141 views
Spring Boot 4.0.0-M1 java.lang.NoClassDefFoundError: Could not initialize class io.opentelemetry.exporter.sender.okhttp.internal.OkHttpGrpcSender
I would like to build a native image with the newly released (as of this writing) Spring Boot 4.0.0-M1 and GraalVM AOT With this code: @Configuration public class TracingConfiguration { @Bean ...
0 votes
1 answer
54 views
I got java.io.FileNotFoundException when I call URL.openStream()
I have an URL for file downloading and it works perfectly on my Samsung Galaxy S10 (running Android 12), but the same app throws java.io.FileNotFoundException on my Google Pixel 9 with the latest ...
4 votes
1 answer
963 views
How to setup OkHttp v5 with Maven?
OkHttp recently received a v5 update, meaning there are breaking changes. I've noticed these breaking changes, as my project no longer recognizes OkHttp or any of its classes. Unfortunately is the ...
0 votes
1 answer
143 views
Websockets Ktor/OkHTTP server sends ping, doesn't receive pong
I implemented a basic websockets server, following the instructions on the Ktor site (server, client). Server (complete source): webSocket("/echo") { send("Please enter your name&...
1 vote
2 answers
214 views
How to decide whether to use chunked upload in OkHttp or not?
I am uploading files to WebDav servers using RequestBody requestBody = new MultipartBody.Builder() .addPart(RequestBody.create(data, MediaType.parse("application/...
1 vote
1 answer
113 views
OkHttpClient throws IllegalStateException when server responds with 100-Continue
OkHttpClient version 4-12.0 sends multipart-form request using default configuration ; Sever responds with 100-Continue . After receiving couple of 100-Continue OkHttpClient fails with ...
1 vote
1 answer
118 views
Python flask server 405 error for a specific path when hosted on Azure, works fine locally
I'm building a flask app to process images uploaded from a mobile device, before sending results back to the mobile app. I've successfully deployed the flask app on Azure, and can confirm it works ...
1 vote
2 answers
913 views
CertPathValidatorException: Trust anchor for certification path not found (Android 15 and below)
We recently switched from HttpUrlConnection to OkHttp (v4.12.0) on Android and started seeing CertPathValidatorException: Trust anchor for certification path not found from a small percentage of our ...
1 vote
0 answers
117 views
Java okhttp3 Exceptions
My Spring Boot uses okhttp3 to send HTTP requests as a client. I have no control over the servers. (But I can ask server team to change the settings if needs be.) <dependency> <groupId>...