use of org.apereo.cas.configuration.model.core.web.tomcat.CasEmbeddedApacheTomcatHttpProperties in project cas by apereo.
the class CasEmbeddedContainerTomcatConfiguration method configureHttp.
private void configureHttp(final TomcatEmbeddedServletContainerFactory tomcat) {
final CasEmbeddedApacheTomcatHttpProperties http = casProperties.getServer().getHttp();
if (http.isEnabled()) {
LOGGER.debug("Creating HTTP configuration for the embedded tomcat container...");
final Connector connector = new Connector(http.getProtocol());
int port = http.getPort();
if (port <= 0) {
LOGGER.warn("No explicit port configuration is provided to CAS. Scanning for available ports...");
port = SocketUtils.findAvailableTcpPort();
}
LOGGER.info("Activated embedded tomcat container HTTP port on [{}]", port);
connector.setPort(port);
LOGGER.debug("Configuring embedded tomcat container for HTTP2 protocol support");
connector.addUpgradeProtocol(new Http2Protocol());
http.getAttributes().forEach(connector::setAttribute);
tomcat.addAdditionalTomcatConnectors(connector);
}
}
Aggregations