use of okhttp3.Authenticator in project codekvast by crispab.
the class AgentConfig method getHttpClient.
public OkHttpClient getHttpClient() {
if (httpClient == null) {
validate();
OkHttpClient.Builder builder = new OkHttpClient.Builder().connectTimeout(httpConnectTimeoutSeconds, TimeUnit.SECONDS).writeTimeout(httpWriteTimeoutSeconds, TimeUnit.SECONDS).readTimeout(httpReadTimeoutSeconds, TimeUnit.SECONDS);
Proxy proxy = createHttpProxy();
if (proxy != null) {
builder.proxy(proxy);
}
Authenticator proxyAuthenticator = createProxyAuthenticator();
if (proxyAuthenticator != null) {
builder.proxyAuthenticator(proxyAuthenticator);
}
httpClient = builder.build();
}
return httpClient;
}
Aggregations