public static javax.net.ServerSocketFactory getServerSocketFactory()
            throws IOException {
        if (isSslEnabled()) {
            if (sslFactory == null) {
                try {
                    sslFactory = BogusSslContextFactory.getInstance(true)
                            .getServerSocketFactory();
                } catch (GeneralSecurityException e) {
                    IOException ioe = new IOException(
                            "could not create SSL socket");
                    ioe.initCause(e);
                    throw ioe;
                }
            }
            return sslFactory;
        } else {
            if (factory == null) {
                factory = new SslServerSocketFactory();
            }
            return factory;
        }

    }