Relative Content

Tag Archive for okhttp

Does OkHttp honors the proxy and non-proxy system settings?

We are in a case where a microservice needs to use a proxy for some calls, but not all. Additionally, OkHttp is used by one of the libraries we rely on, so we do not want to add extra code, we want to use only configuration updates.
So we planned on using the usual system properties -Dhttps.proxyHost, -Dhttps.proxyPort, and -Dhttps.nonProxyHosts as JVM arguments.
I see a lot of discussions regarding the actual support of proxies in OkHpttp, so the question is basically: Does OkHttp honor those system settings?
My testing seems to go in the direction of nonProxyHosts non being honored, but I prefer to be sure as I get: