Source:
<code>public IClient build() { try { TrustManagerFactory trustManagerFactory = initTrustManagerFactory(certificateAlias, certificate, certificateCollection); X509TrustManager trustManager = getCurrentTrustManager(trustManagerFactory); SSLContext sslContext = SSLUtils.getSSLContext(trustManager); ResponseCodeInterceptor responseCodeInterceptor = new ResponseCodeInterceptor(); OpenShiftAuthenticator authenticator = new OpenShiftAuthenticator(); Dispatcher dispatcher = new Dispatcher(); dispatcher.setMaxRequests(maxRequests); dispatcher.setMaxRequestsPerHost(maxRequestsPerHost); OkHttpClient.Builder builder = new OkHttpClient.Builder() .addInterceptor(responseCodeInterceptor) .addNetworkInterceptor(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { <START> Request agent = chain.request().newBuilder().header("User-Agent", "openshift-restclient-java/"+Version.userAgent()).build(); <END> return chain.proceed(agent); } }) .authenticator(authenticator) .dispatcher(dispatcher) .readTimeout(readTimeout, readTimeoutUnit) .writeTimeout(writeTimeout, writeTimeoutUnit) .connectTimeout(connectTimeout, connectTimeoutUnit) .sslSocketFactory(sslContext.getSocketFactory(), trustManager); if (!this.sslCertCallbackWithDefaultHostnameVerifier) builder.hostnameVerifier(sslCertificateCallback); if (proxyAuthenticator != null) { builder.proxyAuthenticator(proxyAuthenticator); } OkHttpClient okClient = builder.build(); IResourceFactory factory = defaultIfNull(resourceFactory, new ResourceFactory(null)); AuthorizationContext authContext = new AuthorizationContext(token, userName, password); DefaultClient client = new DefaultClient(new URL(this.baseUrl), okClient, factory, null, authContext); authContext.setClient(client); responseCodeInterceptor.setClient(client); authenticator.setClient(client); authenticator.setOkClient(okClient); return client; } catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException | CertificateException | IOException e) { throw new OpenShiftException(e, "Unable to initialize client"); } }</code><technical_language>more useful allow a user of ClientBuilder set useragent determine application requests originating? part of problem address here, is bad actor</technical_language>

Target:
public IClient build() { try { TrustManagerFactory trustManagerFactory = initTrustManagerFactory(certificateAlias, certificate, certificateCollection); X509TrustManager trustManager = getCurrentTrustManager(trustManagerFactory); SSLContext sslContext = SSLUtils.getSSLContext(trustManager); ResponseCodeInterceptor responseCodeInterceptor = new ResponseCodeInterceptor(); OpenShiftAuthenticator authenticator = new OpenShiftAuthenticator(); Dispatcher dispatcher = new Dispatcher(); dispatcher.setMaxRequests(maxRequests); dispatcher.setMaxRequestsPerHost(maxRequestsPerHost); String[] pieces = {this.userAgentPrefix, "openshift-restclient-java", Version.userAgent()}; String userAgent = StringUtils.join(pieces, "/"); OkHttpClient.Builder builder = new OkHttpClient.Builder() .addInterceptor(responseCodeInterceptor) .addNetworkInterceptor(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Request agent = chain.request().newBuilder().header("User-Agent", userAgent).build(); return chain.proceed(agent); } }) .authenticator(authenticator) .dispatcher(dispatcher) .readTimeout(readTimeout, readTimeoutUnit) .writeTimeout(writeTimeout, writeTimeoutUnit) .connectTimeout(connectTimeout, connectTimeoutUnit) .sslSocketFactory(sslContext.getSocketFactory(), trustManager); if (!this.sslCertCallbackWithDefaultHostnameVerifier) builder.hostnameVerifier(sslCertificateCallback); if (proxyAuthenticator != null) { builder.proxyAuthenticator(proxyAuthenticator); } OkHttpClient okClient = builder.build(); IResourceFactory factory = defaultIfNull(resourceFactory, new ResourceFactory(null)); AuthorizationContext authContext = new AuthorizationContext(token, userName, password); DefaultClient client = new DefaultClient(new URL(this.baseUrl), okClient, factory, null, authContext); authContext.setClient(client); responseCodeInterceptor.setClient(client); authenticator.setClient(client); authenticator.setOkClient(okClient); return client; } catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException | CertificateException | IOException e) { throw new OpenShiftException(e, "Unable to initialize client"); } }