public SslContext createClientModeSslContext() throws SSLException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException {

        // We will never send SSLV2 ClientHello messages
        Set<String> protocols = new HashSet<>(configuration.getEncryptionProtocols());
        protocols.remove("SSLv2Hello");

        // createClientModeSslContext is only used when the Openfire server is acting as a client when
        // making outbound S2S connections so the first stanza we send should be encrypted hence startTls(false)

        return SslContextBuilder
            .forClient()
            .protocols(protocols)
            .ciphers(configuration.getEncryptionCipherSuites())
            .keyManager(getKeyManagerFactory())
            .trustManager(getTrustManagers()[0]) // The existing implementation never returns more than one trust manager.
            .startTls(false) // Acting as client making outbound S2S connection so encrypt next stanza
            .build();
    }
Create and configure a new SslContext instance for a Netty client.<p>

Used when the Openfire server is acting as a client when making S2S connections.

@return A secure socket protocol implementation which acts as a factory for {@link SSLContext} and {@link io.netty.handler.ssl.SslHandler}
xmppserver/src/main/java/org/jivesoftware/openfire/spi/EncryptionArtifactFactory.java