@Override
    public void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress,
                        ChannelPromise connectionPromise) throws Exception {

        // Remember the requested remote address for later use.
        this.remoteAddress = remoteAddress;

        // Configure the pipeline.
        final Channel ch = ctx.channel();
        ChannelUtil.disableWriterBufferWatermark(ch);

        final ChannelPipeline p = ch.pipeline();
        p.addLast(new FlushConsolidationHandler());
        p.addLast(ReadSuppressingAndChannelDeactivatingHandler.INSTANCE);

        try {
            if (isHttps()) {
                configureAsHttps(ch, remoteAddress);
            } else {
                configureAsHttp(ch, connectionPromise);
            }
        } catch (Throwable t) {
            connectionPromise.tryFailure(t);
            ctx.close();
            return;
        } finally {
            if (p.context(this) != null) {
                p.remove(this);
            }
        }

        ctx.connect(remoteAddress, localAddress, connectionPromise);
    }
The maximum allowed content length of an HTTP/1 to 2 upgrade response.
core/src/main/java/com/linecorp/armeria/client/HttpClientPipelineConfigurator.java