code: private ChannelInitializer<SocketChannel> getChannelInitializer(final PravegaNodeUri location,
                                                                      final FlowHandler handler) {
          final SslContext sslCtx = getSslContext();
  
          return new ChannelInitializer<SocketChannel>() {
              @Override
              public void initChannel(SocketChannel ch) throws Exception {
                  ChannelPipeline p = ch.pipeline();
                  if (sslCtx != null) {
                      SslHandler sslHandler = sslCtx.newHandler(ch.alloc(), location.getEndpoint(), location.getPort());
  
                      if (clientConfig.isValidateHostName()) {
                          SSLEngine sslEngine = sslHandler.engine();
                          SSLParameters sslParameters = sslEngine.getSSLParameters();
                          sslParameters.setEndpointIdentificationAlgorithm("HTTPS");
                          sslEngine.setSSLParameters(sslParameters);
                      }
                      p.addLast(sslHandler);
                  }
                  p.addLast(
                          new ExceptionLoggingHandler(location.getEndpoint()),
                          new CommandEncoder(handler.getBatchSizeTracker()),
                          new LengthFieldBasedFrameDecoder(WireCommands.MAX_WIRECOMMAND_SIZE, 4, 4),
                          new CommandDecoder(),
                          handler);
              }
          };
      }
docs: Create a Channel Initializer which is to to setup {@link ChannelPipeline}.