private void sendNewStreamHeader(NettyConnection connection) {
        final Element stream = DocumentHelper.createElement(QName.get("stream", "stream", "http://etherx.jabber.org/streams"));
        final Document document = DocumentHelper.createDocument(stream);
        document.setXMLEncoding(StandardCharsets.UTF_8.toString());
        stream.add(Namespace.get("", "jabber:server"));
        if (ServerDialback.isEnabled() || ServerDialback.isEnabledForSelfSigned()) {
            stream.add(Namespace.get("db", "jabber:server:dialback"));
        }
        stream.addAttribute("from", domainPair.getLocal()); // OF-673
        stream.addAttribute("to", domainPair.getRemote());
        stream.addAttribute("version", "1.0");

        connection.deliverRawText(StringUtils.asUnclosedStream(document));
    }
Called when SSL Handshake has been completed.

If successful, attempts authentication via SASL, or dialback dependent on configuration and certificate validity.
If not successful, either attempts dialback on a plain un-encrypted connection, or throws an exception dependent
on configuration.

@param ctx ChannelHandlerContext for the Netty channel
@param evt Event that has been triggered - this implementation specifically identifies SslHandshakeCompletionEvent
@throws Exception
xmppserver/src/main/java/org/jivesoftware/openfire/nio/NettyOutboundConnectionHandler.java