private static void configureConnectorForProtocol(final Connector connector,
                                                      final CasEmbeddedApacheTomcatHttpProxyProperties proxy) {
        val handler = ReflectionUtils.findField(connector.getClass(), "protocolHandler");
        if (handler != null) {
            ReflectionUtils.makeAccessible(handler);
            if ("HTTP/2".equalsIgnoreCase(proxy.getProtocol())) {
                connector.addUpgradeProtocol(new Http2Protocol());
            } else {
                val protocolHandlerInstance = switch (proxy.getProtocol()) {
                    case "AJP/2" -> new AjpNio2Protocol();
                    case "HTTP/1.2" -> new Http11Nio2Protocol();
                    case "HTTP/1.1" -> new Http11NioProtocol();
                    default -> new AjpNioProtocol();
                };
                if (protocolHandlerInstance instanceof final AbstractAjpProtocol ajp) {
                    ajp.setSecretRequired(proxy.isSecure());
                    ajp.setSecret(proxy.getSecret());
                }
                protocolHandlerInstance.setPort(connector.getPort());
                ReflectionUtils.setField(handler, connector, protocolHandlerInstance);
            }
            val handlerClass = ReflectionUtils.findField(connector.getClass(), "protocolHandlerClassName");
            if (handlerClass != null) {
                ReflectionUtils.makeAccessible(handlerClass);
                ReflectionUtils.setField(handlerClass, connector, connector.getProtocolHandler().getClass().getName());
            }
        }
    }
This is {@link CasTomcatServletWebServerFactoryCustomizer}.

@author Misagh Moayyed
@since 6.1.0
webapp/cas-server-webapp-init-tomcat/src/main/java/org/apereo/cas/tomcat/CasTomcatServletWebServerFactoryCustomizer.java