ClientFactory clientFactory(boolean webSocket) {
        final ClientFactoryBuilderHolder factoryBuilderHolder = new ClientFactoryBuilderHolder();
        if (connectTimeout != null && !connectTimeout.isZero() && !connectTimeout.isNegative()) {
            factoryBuilderHolder.get().connectTimeout(connectTimeout);
        }

        // Kubernetes WebSocket does not support HTTP/2.
        if (isPreferHttp11() || webSocket) {
            factoryBuilderHolder.get().preferHttp1(true);
        }

        if (sslContext != null) {
            final KeyManager keyManager =
                    (keyManagers != null && keyManagers.length > 0) ? keyManagers[0] : null;
            final TrustManager trustManager =
                    (trustManagers != null && trustManagers.length > 0) ? trustManagers[0] : null;

            // TODO(ikhoon): Use TlsProvider when https://github.com/line/armeria/pull/5228 is merged.
            factoryBuilderHolder.get().tlsCustomizer(sslContextBuilder -> {
                if (keyManager != null) {
                    sslContextBuilder.keyManager(keyManager);
                }
                if (trustManager != null) {
                    sslContextBuilder.trustManager(trustManager);
                }
            });
        }

        if (tlsVersions != null && tlsVersions.length > 0) {
            factoryBuilderHolder.get().tlsCustomizer(sslContextBuilder -> {
                sslContextBuilder.protocols(Stream.of(tlsVersions)
                                                  .map(TlsVersion::javaName)
                                                  .collect(toImmutableList()));
            });
        }

        ProxyConfig proxyConfig = null;
        if (proxyAddress != null) {
            switch (proxyType) {
                case HTTP:
                    if (proxyAuthorization != null) {
                        final HttpHeaders headers = HttpHeaders.of(HttpHeaderNames.PROXY_AUTHORIZATION,
                                                                   proxyAuthorization);
                        proxyConfig = ProxyConfig.connect(proxyAddress, headers, false);
                    } else {
                        proxyConfig = ProxyConfig.connect(proxyAddress);
                    }
                    break;
                case SOCKS4:
                    proxyConfig = ProxyConfig.socks4(proxyAddress);
                    break;
                case SOCKS5:
                    proxyConfig = ProxyConfig.socks5(proxyAddress);
                    break;
            }
        }
        if (proxyConfig != null) {
            factoryBuilderHolder.get().proxyConfig(proxyConfig);
        }

        return factoryBuilderHolder.maybeBuild();
    }
A {@link StandardHttpClientBuilder} to build an {@link ArmeriaHttpClient}.
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/ArmeriaHttpClientBuilder.java