Search in sources :

Example 1 with HTTPSPDYServerConnector

use of org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnector in project Openfire by igniterealtime.

the class HttpBindManager method createSSLConnector.

private void createSSLConnector(int securePort) {
    httpsConnector = null;
    try {
        final IdentityStore identityStore = XMPPServer.getInstance().getCertificateStoreManager().getIdentityStore(ConnectionType.BOSH_C2S);
        if (securePort > 0 && identityStore.getStore().aliases().hasMoreElements()) {
            if (!identityStore.containsDomainCertificate("RSA")) {
                Log.warn("HTTP binding: Using RSA certificates but they are not valid for " + "the hosted domain");
            }
            final ConnectionManagerImpl connectionManager = ((ConnectionManagerImpl) XMPPServer.getInstance().getConnectionManager());
            final ConnectionConfiguration configuration = connectionManager.getListener(ConnectionType.BOSH_C2S, true).generateConnectionConfiguration();
            final SslContextFactory sslContextFactory = new EncryptionArtifactFactory(configuration).getSslContextFactory();
            final HttpConfiguration httpsConfig = new HttpConfiguration();
            httpsConfig.setSecureScheme("https");
            httpsConfig.setSecurePort(securePort);
            configureProxiedConnector(httpsConfig);
            httpsConfig.addCustomizer(new SecureRequestCustomizer());
            final ServerConnector sslConnector;
            if ("npn".equals(JiveGlobals.getXMLProperty("spdy.protocol", ""))) {
                sslConnector = new HTTPSPDYServerConnector(httpBindServer, sslContextFactory);
            } else {
                sslConnector = new ServerConnector(httpBindServer, new SslConnectionFactory(sslContextFactory, "http/1.1"), new HttpConnectionFactory(httpsConfig));
            }
            sslConnector.setHost(getBindInterface());
            sslConnector.setPort(securePort);
            httpsConnector = sslConnector;
        }
    } catch (Exception e) {
        Log.error("Error creating SSL connector for Http bind", e);
    }
}
Also used : HTTPSPDYServerConnector(org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnector) ServerConnector(org.eclipse.jetty.server.ServerConnector) SslContextFactory(org.eclipse.jetty.util.ssl.SslContextFactory) SecureRequestCustomizer(org.eclipse.jetty.server.SecureRequestCustomizer) ConnectionManagerImpl(org.jivesoftware.openfire.spi.ConnectionManagerImpl) ConnectionConfiguration(org.jivesoftware.openfire.spi.ConnectionConfiguration) HttpConnectionFactory(org.eclipse.jetty.server.HttpConnectionFactory) EncryptionArtifactFactory(org.jivesoftware.openfire.spi.EncryptionArtifactFactory) HttpConfiguration(org.eclipse.jetty.server.HttpConfiguration) HTTPSPDYServerConnector(org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnector) SslConnectionFactory(org.eclipse.jetty.server.SslConnectionFactory) IdentityStore(org.jivesoftware.openfire.keystore.IdentityStore) ServletException(javax.servlet.ServletException)

Example 2 with HTTPSPDYServerConnector

use of org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnector in project Openfire by igniterealtime.

the class AdminConsolePlugin method logAdminConsolePorts.

private void logAdminConsolePorts() {
    // Log what ports the admin console is running on.
    String listening = LocaleUtils.getLocalizedString("admin.console.listening");
    String hostname = getBindInterface() == null ? XMPPServer.getInstance().getServerInfo().getXMPPDomain() : getBindInterface();
    boolean isPlainStarted = false;
    boolean isSecureStarted = false;
    boolean isSPDY = false;
    for (Connector connector : adminServer.getConnectors()) {
        if (((ServerConnector) connector).getPort() == adminPort) {
            isPlainStarted = true;
        } else if (((ServerConnector) connector).getPort() == adminSecurePort) {
            isSecureStarted = true;
        }
        if (connector instanceof HTTPSPDYServerConnector) {
            isSPDY = true;
        }
    }
    if (isPlainStarted && isSecureStarted) {
        log(listening + ":" + System.getProperty("line.separator") + "  http://" + hostname + ":" + adminPort + System.getProperty("line.separator") + "  https://" + hostname + ":" + adminSecurePort + (isSPDY ? " (SPDY)" : ""));
    } else if (isSecureStarted) {
        log(listening + " https://" + hostname + ":" + adminSecurePort + (isSPDY ? " (SPDY)" : ""));
    } else if (isPlainStarted) {
        log(listening + " http://" + hostname + ":" + adminPort);
    }
}
Also used : HTTPSPDYServerConnector(org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnector) ServerConnector(org.eclipse.jetty.server.ServerConnector) HTTPSPDYServerConnector(org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnector) ServerConnector(org.eclipse.jetty.server.ServerConnector) Connector(org.eclipse.jetty.server.Connector) HTTPSPDYServerConnector(org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnector)

Aggregations

ServerConnector (org.eclipse.jetty.server.ServerConnector)2 HTTPSPDYServerConnector (org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnector)2 ServletException (javax.servlet.ServletException)1 Connector (org.eclipse.jetty.server.Connector)1 HttpConfiguration (org.eclipse.jetty.server.HttpConfiguration)1 HttpConnectionFactory (org.eclipse.jetty.server.HttpConnectionFactory)1 SecureRequestCustomizer (org.eclipse.jetty.server.SecureRequestCustomizer)1 SslConnectionFactory (org.eclipse.jetty.server.SslConnectionFactory)1 SslContextFactory (org.eclipse.jetty.util.ssl.SslContextFactory)1 IdentityStore (org.jivesoftware.openfire.keystore.IdentityStore)1 ConnectionConfiguration (org.jivesoftware.openfire.spi.ConnectionConfiguration)1 ConnectionManagerImpl (org.jivesoftware.openfire.spi.ConnectionManagerImpl)1 EncryptionArtifactFactory (org.jivesoftware.openfire.spi.EncryptionArtifactFactory)1