Search in sources :

Example 6 with IdentityStore

use of org.jivesoftware.openfire.keystore.IdentityStore in project Openfire by igniterealtime.

the class XMPPServer method finalSetupSteps.

private void finalSetupSteps() {
    for (String propName : JiveGlobals.getXMLPropertyNames()) {
        if (!XML_ONLY_PROPERTIES.contains(propName)) {
            if (JiveGlobals.getProperty(propName) == null) {
                JiveGlobals.setProperty(propName, JiveGlobals.getXMLProperty(propName));
            }
            JiveGlobals.setPropertyEncrypted(propName, JiveGlobals.isXMLPropertyEncrypted(propName));
        }
    }
    // Check if keystore (that out-of-the-box is a fallback for all keystores) already has certificates for current domain.
    // Will be a module after finishing setup.
    CertificateStoreManager certificateStoreManager = null;
    try {
        certificateStoreManager = new CertificateStoreManager();
        certificateStoreManager.initialize(this);
        certificateStoreManager.start();
        final IdentityStore identityStore = certificateStoreManager.getIdentityStore(ConnectionType.SOCKET_C2S);
        identityStore.ensureDomainCertificate();
    } catch (Exception e) {
        logger.error("Error generating self-signed certificates", e);
    } finally {
        if (certificateStoreManager != null) {
            certificateStoreManager.stop();
            certificateStoreManager.destroy();
        }
    }
    // Initialize list of admins now (before we restart Jetty)
    AdminManager.getInstance().getAdminAccounts();
}
Also used : CertificateStoreManager(org.jivesoftware.openfire.keystore.CertificateStoreManager) IdentityStore(org.jivesoftware.openfire.keystore.IdentityStore) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) FileNotFoundException(java.io.FileNotFoundException)

Aggregations

IdentityStore (org.jivesoftware.openfire.keystore.IdentityStore)6 SslContextFactory (org.eclipse.jetty.util.ssl.SslContextFactory)3 IOException (java.io.IOException)2 HttpConfiguration (org.eclipse.jetty.server.HttpConfiguration)2 HttpConnectionFactory (org.eclipse.jetty.server.HttpConnectionFactory)2 SecureRequestCustomizer (org.eclipse.jetty.server.SecureRequestCustomizer)2 ServerConnector (org.eclipse.jetty.server.ServerConnector)2 SslConnectionFactory (org.eclipse.jetty.server.SslConnectionFactory)2 CertificateStoreManager (org.jivesoftware.openfire.keystore.CertificateStoreManager)2 ConnectionConfiguration (org.jivesoftware.openfire.spi.ConnectionConfiguration)2 ConnectionManagerImpl (org.jivesoftware.openfire.spi.ConnectionManagerImpl)2 EncryptionArtifactFactory (org.jivesoftware.openfire.spi.EncryptionArtifactFactory)2 FileNotFoundException (java.io.FileNotFoundException)1 UnknownHostException (java.net.UnknownHostException)1 ServletException (javax.servlet.ServletException)1 ContextHandlerCollection (org.eclipse.jetty.server.handler.ContextHandlerCollection)1 DefaultHandler (org.eclipse.jetty.server.handler.DefaultHandler)1 HandlerCollection (org.eclipse.jetty.server.handler.HandlerCollection)1 HTTPSPDYServerConnector (org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnector)1 QueuedThreadPool (org.eclipse.jetty.util.thread.QueuedThreadPool)1