I have a web container (Glassfish) with a proxy configured on its system properties for one application.
Now i have another application on the same web container and would like to customize proxy usage via code using OkHttpClient.
The problem is that OkHttpClient is automatically using the proxy configured in system properties. Here is my code to instantiate a HTTP client:
httpClient = new OkHttpClient.Builder()
.connectTimeout(60, TimeUnit.SECONDS)
.writeTimeout(60, TimeUnit.SECONDS)
.readTimeout(60, TimeUnit.SECONDS)
.build();
When i try to do a GET request, it fails telling me that it couldn't connect via the specified proxy host. Is there a way to ignore a proxy on system properties?