private void applyTlsConfig(SslContextBuilder contextBuilder) {
        if (tlsConfig == null) {
            return;
        }

        if (tlsConfig instanceof ServerTlsConfig) {
            final ServerTlsConfig serverTlsConfig = (ServerTlsConfig) tlsConfig;
            contextBuilder.clientAuth(serverTlsConfig.clientAuth());
        } else {
            final ClientTlsConfig clientTlsConfig = (ClientTlsConfig) tlsConfig;
            if (clientTlsConfig.tlsNoVerifySet()) {
                contextBuilder.trustManager(InsecureTrustManagerFactory.INSTANCE);
            } else if (!clientTlsConfig.insecureHosts().isEmpty()) {
                contextBuilder.trustManager(IgnoreHostsTrustManager.of(clientTlsConfig.insecureHosts()));
            }
        }
        tlsConfig.tlsCustomizer().accept(contextBuilder);
    }
Returns an {@link SslContext} for the specified {@link SslContextMode} and {@link TlsKeyPair}.
Note that the returned {@link SslContext} should be released via
{@link ReferenceCountUtil#release(Object)} when it is no longer used.
core/src/main/java/com/linecorp/armeria/internal/common/SslContextFactory.java