Search in sources :

Example 1 with SSLContextFactory

use of org.apache.nifi.io.socket.SSLContextFactory in project nifi by apache.

the class ServerSocketConfigurationFactoryBean method getObject.

@Override
public ServerSocketConfiguration getObject() throws Exception {
    if (configuration == null) {
        configuration = new ServerSocketConfiguration();
        configuration.setNeedClientAuth(properties.getNeedClientAuth());
        final int timeout = (int) FormatUtils.getTimeDuration(properties.getClusterNodeReadTimeout(), TimeUnit.MILLISECONDS);
        configuration.setSocketTimeout(timeout);
        configuration.setReuseAddress(true);
        if (Boolean.valueOf(properties.getProperty(NiFiProperties.CLUSTER_PROTOCOL_IS_SECURE))) {
            configuration.setSSLContextFactory(new SSLContextFactory(properties));
        }
    }
    return configuration;
}
Also used : ServerSocketConfiguration(org.apache.nifi.io.socket.ServerSocketConfiguration) SSLContextFactory(org.apache.nifi.io.socket.SSLContextFactory)

Example 2 with SSLContextFactory

use of org.apache.nifi.io.socket.SSLContextFactory in project nifi by apache.

the class SocketConfigurationFactoryBean method getObject.

@Override
public SocketConfiguration getObject() throws Exception {
    if (configuration == null) {
        configuration = new SocketConfiguration();
        final int timeout = (int) FormatUtils.getTimeDuration(properties.getClusterNodeReadTimeout(), TimeUnit.MILLISECONDS);
        configuration.setSocketTimeout(timeout);
        configuration.setReuseAddress(true);
        if (Boolean.valueOf(properties.getProperty(NiFiProperties.CLUSTER_PROTOCOL_IS_SECURE))) {
            configuration.setSSLContextFactory(new SSLContextFactory(properties));
        }
    }
    return configuration;
}
Also used : SocketConfiguration(org.apache.nifi.io.socket.SocketConfiguration) SSLContextFactory(org.apache.nifi.io.socket.SSLContextFactory)

Aggregations

SSLContextFactory (org.apache.nifi.io.socket.SSLContextFactory)2 ServerSocketConfiguration (org.apache.nifi.io.socket.ServerSocketConfiguration)1 SocketConfiguration (org.apache.nifi.io.socket.SocketConfiguration)1