public SSLEngine createServerModeSSLEngine() throws UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException
    {
        final SSLEngine sslEngine = createSSLEngine( );
        sslEngine.setUseClientMode( false );

        switch ( configuration.getClientAuth() )
        {
            case needed:
                sslEngine.setNeedClientAuth( true );
                break;

            case wanted:
                sslEngine.setWantClientAuth( true );
                break;

            case disabled:
                sslEngine.setWantClientAuth( false );
                break;
        }

        return sslEngine;
    }
Creates a new SSL Engine that is configured to use server mode when handshaking.

For Openfire, an engine is of this mode used for most purposes (as Openfire is a server by nature).

@return A new, initialized SSLEngine instance (never null).
@throws UnrecoverableKeyException if the key could not be recovered
@throws NoSuchAlgorithmException if the algorithm is not supported
@throws KeyStoreException if there was a problem accessing the keystore
@throws KeyManagementException if there was problem manging the ket
xmppserver/src/main/java/org/jivesoftware/openfire/spi/EncryptionArtifactFactory.java