use of org.apache.mina.filter.ssl.SslFilter in project Openfire by igniterealtime.
the class NIOConnection method startTLS.
public void startTLS(boolean clientMode, boolean directTLS) throws Exception {
final EncryptionArtifactFactory factory = new EncryptionArtifactFactory(configuration);
final SslFilter filter;
if (clientMode) {
filter = factory.createClientModeSslFilter();
} else {
filter = factory.createServerModeSslFilter();
}
ioSession.getFilterChain().addBefore(EXECUTOR_FILTER_NAME, TLS_FILTER_NAME, filter);
if (!directTLS) {
ioSession.setAttribute(SslFilter.DISABLE_ENCRYPTION_ONCE, Boolean.TRUE);
}
if (!clientMode && !directTLS) {
// Indicate the client that the server is ready to negotiate TLS
deliverRawText("<proceed xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>");
}
}
Aggregations