String keystorePath = connectorConfig.keystorePath;
String keystorePassword = connectorConfig.keystorePassword;
String certType = connectorConfig.certType;
SSLContextFactory sslContextFactory = new SSLContextFactory(keystorePath, keystorePassword, certType);
protocolSession.getFilterChain().addAfter("AsynchronousReadFilter", "sslFilter",
new SSLFilter(sslContextFactory.buildServerContext()));
}
protocolSession.getFilterChain().addBefore("AsynchronousWriteFilter", "protocolFilter", pcf);
}
else
{
protocolSession.getFilterChain().addLast("protocolFilter", pcf);
if (connectorConfig.enableSSL && isSSLClient(connectorConfig, protocolSession))
{
String keystorePath = connectorConfig.keystorePath;
String keystorePassword = connectorConfig.keystorePassword;
String certType = connectorConfig.certType;
SSLContextFactory sslContextFactory = new SSLContextFactory(keystorePath, keystorePassword, certType);
protocolSession.getFilterChain().addBefore("protocolFilter", "sslFilter",
new SSLFilter(sslContextFactory.buildServerContext()));
}
}
if (ApplicationRegistry.getInstance().getConfiguration().getBoolean("broker.connector.protectio.enabled", false))