private void configureUpgradeCodec(Channel ch, Consumer<ChannelHandler> pipelineCustomizer) {
        final Http2ClientConnectionHandler http2Handler = newHttp2ConnectionHandler(ch, http2);
        // - h2c: HTTP/2 preface is always used.
        // - http: Either HTTP/1.1 upgrade or HTTP/2 preface is used depending on 'useHttp2Preface()'.
        final boolean shouldUsePreface = httpPreference == HttpPreference.HTTP2_REQUIRED ||
                                         clientFactory.useHttp2Preface();
        if (shouldUsePreface) {
            pipelineCustomizer.accept(new DowngradeHandler());
            pipelineCustomizer.accept(http2Handler);
        } else {
            final HttpClientCodec http1Codec = newHttp1Codec(
                    clientFactory.http1MaxInitialLineLength(),
                    clientFactory.http1MaxHeaderSize(),
                    clientFactory.http1MaxChunkSize());
            final Http2ClientUpgradeCodec http2ClientUpgradeCodec =
                    new Http2ClientUpgradeCodec(http2Handler);
            final HttpClientUpgradeHandler http2UpgradeHandler =
                    new HttpClientUpgradeHandler(
                            http1Codec, http2ClientUpgradeCodec,
                            (int) Math.min(Integer.MAX_VALUE, UPGRADE_RESPONSE_MAX_LENGTH));

            pipelineCustomizer.accept(http1Codec);
            pipelineCustomizer.accept(new WorkaroundHandler());
            pipelineCustomizer.accept(http2UpgradeHandler);
            pipelineCustomizer.accept(new UpgradeRequestHandler(http2Handler.responseDecoder()));
        }
    }
Configures the specified {@link SslHandler} with common settings.
core/src/main/java/com/linecorp/armeria/client/HttpClientPipelineConfigurator.java