public static boolean isAprAvailable() { //https://bz.apache.org/bugzilla/show_bug.cgi?id=48613 if (instanceCreated) { synchronized (lock) { init(); } } return aprAvailable; }
/** * @return the Coyote protocol handler in use. */ public String getProtocol() { if (("org.apache.coyote.http11.Http11NioProtocol".equals(getProtocolHandlerClassName()) && (!AprLifecycleListener.isAprAvailable() || !AprLifecycleListener.getUseAprConnector())) || "org.apache.coyote.http11.Http11AprProtocol".equals(getProtocolHandlerClassName()) && AprLifecycleListener.getUseAprConnector()) { return "HTTP/1.1"; } else if (("org.apache.coyote.ajp.AjpNioProtocol".equals(getProtocolHandlerClassName()) && (!AprLifecycleListener.isAprAvailable() || !AprLifecycleListener.getUseAprConnector())) || "org.apache.coyote.ajp.AjpAprProtocol".equals(getProtocolHandlerClassName()) && AprLifecycleListener.getUseAprConnector()) { return "AJP/1.3"; } return getProtocolHandlerClassName(); }
init(); if (aprAvailable) { try { initializeSSL(); } catch (Throwable t) { t = ExceptionUtils.unwrapInvocationTargetException(t); if ("on".equalsIgnoreCase(FIPSMode) && !isFIPSModeActive()) { Error e = new Error( sm.getString("aprListener.initializeFIPSFailed")); terminateAPR(); } catch (Throwable t) { t = ExceptionUtils.unwrapInvocationTargetException(t);
aprInitialized = init(); if (aprInitialized) { try { initializeSSL(); } catch (Throwable t) { if (!log.isDebugEnabled()) { terminateAPR(); } catch (Throwable t) { if (!log.isDebugEnabled()) {
/** * Primary entry point for startup and shutdown events. * * @param event The event that has occurred */ public void lifecycleEvent(LifecycleEvent event) { if (Lifecycle.INIT_EVENT.equals(event.getType())) { aprInitialized = init(); if (aprInitialized) { try { initializeSSL(); } catch (Throwable t) { if (!CatalinaLogger.CORE_LOGGER.isDebugEnabled()) { CatalinaLogger.CORE_LOGGER.aprSslEngineInitFailed(); } else { CatalinaLogger.CORE_LOGGER.aprSslEngineInitFailedWithThrowable(t); } } } } }
terminateAPR(); } catch (Throwable t) {
if (AprLifecycleListener.isAprAvailable()) { if ("HTTP/1.1".equals(protocol)) { setProtocolHandlerClassName
Context context = tomcat.addContext("", baseDir); AprLifecycleListener aprLifecycleListener = new AprLifecycleListener(); aprLifecycleListener.setSSLEngine("on"); tomcat.getServer().addLifecycleListener(aprLifecycleListener); context.addLifecycleListener(aprLifecycleListener); if (AprLifecycleListener.isAprAvailable()) { tomcat.getConnector().setProtocol("org.apache.coyote.http11.Http11AprProtocol"); } else {
if (protocolHandler.isAprRequired() && !AprLifecycleListener.isAprAvailable()) { throw new LifecycleException(sm.getString("coyoteConnector.protocolHandlerNoApr", getProtocolHandlerClassName())); if (AprLifecycleListener.isAprAvailable() && AprLifecycleListener.getUseOpenSSL() && protocolHandler instanceof AbstractHttp11JsseProtocol) { AbstractHttp11JsseProtocol<?> jsseProtocolHandler =
AprLifecycleListener listener = new AprLifecycleListener(); listener.setSSLEngine("off"); connector.addLifecycleListener(listener);
AprLifecycleListener listener = new AprLifecycleListener(); listener.setSSLRandomSeed("/dev/urandom"); server.addLifecycleListener(listener); connector.setAttribute("pollerThreadCount", Integer.valueOf(1));
public TomcatWebServer(String appBase, int port, String bindInterface) throws ServletException { super(checkNotNull(appBase), port, bindInterface, "Apache Tomcat", "org.apache.tomcat", "tomcat-catalina"); tomcat = new Tomcat(); tomcat.setPort(port); tomcat.setBaseDir("."); tomcat.getHost().setAppBase("."); String contextPath = "/"; // Add AprLifecycleListener StandardServer server = (StandardServer) tomcat.getServer(); AprLifecycleListener listener = new AprLifecycleListener(); server.addLifecycleListener(listener); context = tomcat.addWebapp(contextPath, appBase); }
init(); if (aprAvailable) { try { initializeSSL(); } catch (Throwable t) { t = ExceptionUtils.unwrapInvocationTargetException(t); if ("on".equalsIgnoreCase(FIPSMode) && !isFIPSModeActive()) { Error e = new Error( sm.getString("aprListener.initializeFIPSFailed")); terminateAPR(); } catch (Throwable t) { t = ExceptionUtils.unwrapInvocationTargetException(t);
init(); if (aprAvailable) { try { initializeSSL(); } catch (Throwable t) { ExceptionUtils.handleThrowable(t); terminateAPR(); } catch (Throwable t) { ExceptionUtils.handleThrowable(t);
terminateAPR(); } catch (Throwable t) { ExceptionUtils.handleThrowable(t);
if (AprLifecycleListener.isAprAvailable()) { if ("HTTP/1.1".equals(protocol)) { setProtocolHandlerClassName
if (protocolHandler.isAprRequired() && !AprLifecycleListener.isAprAvailable()) { throw new LifecycleException(sm.getString("coyoteConnector.protocolHandlerNoApr", getProtocolHandlerClassName())); if (AprLifecycleListener.isAprAvailable() && AprLifecycleListener.getUseOpenSSL() && protocolHandler instanceof AbstractHttp11JsseProtocol) { AbstractHttp11JsseProtocol<?> jsseProtocolHandler =
this.tomcat.getServer().addLifecycleListener(new AprLifecycleListener());
init(); for (String msg : initInfoLogMessages) { log.info(msg); if (aprAvailable) { try { initializeSSL(); } catch (Throwable t) { t = ExceptionUtils.unwrapInvocationTargetException(t); if (!(null == FIPSMode || "off".equalsIgnoreCase(FIPSMode)) && !isFIPSModeActive()) { String errorMessage = sm.getString("aprListener.initializeFIPSFailed"); Error e = new Error(errorMessage); terminateAPR(); } catch (Throwable t) { t = ExceptionUtils.unwrapInvocationTargetException(t);
init(); if (aprAvailable) { try { initializeSSL(); } catch (Throwable t) { ExceptionUtils.handleThrowable(t); terminateAPR(); } catch (Throwable t) { ExceptionUtils.handleThrowable(t);