Class SSLUtils


  • public class SSLUtils
    extends Object
    Common utilities to manage SSL transport settings.
    • Constructor Detail

      • SSLUtils

        public SSLUtils()
    • Method Detail

      • createSSLServerSocketFactory

        public static ServerSocketFactory createSSLServerSocketFactory​(org.apache.flink.configuration.Configuration config)
                                                                throws Exception
        Creates a factory for SSL Server Sockets from the given configuration. SSL Server Sockets are always part of internal communication.
        Throws:
        Exception
      • createSSLClientSocketFactory

        public static SocketFactory createSSLClientSocketFactory​(org.apache.flink.configuration.Configuration config)
                                                          throws Exception
        Creates a factory for SSL Client Sockets from the given configuration. SSL Client Sockets are always part of internal communication.
        Throws:
        Exception
      • createInternalServerSSLEngineFactory

        public static SSLHandlerFactory createInternalServerSSLEngineFactory​(org.apache.flink.configuration.Configuration config)
                                                                      throws Exception
        Creates a SSLEngineFactory to be used by internal communication server endpoints.
        Throws:
        Exception
      • createInternalClientSSLEngineFactory

        public static SSLHandlerFactory createInternalClientSSLEngineFactory​(org.apache.flink.configuration.Configuration config)
                                                                      throws Exception
        Creates a SSLEngineFactory to be used by internal communication client endpoints.
        Throws:
        Exception
      • createRestServerSSLEngineFactory

        public static SSLHandlerFactory createRestServerSSLEngineFactory​(org.apache.flink.configuration.Configuration config)
                                                                  throws Exception
        Creates a SSLHandlerFactory to be used by the REST Servers.
        Parameters:
        config - The application configuration.
        Throws:
        Exception
      • createRestClientSSLEngineFactory

        public static SSLHandlerFactory createRestClientSSLEngineFactory​(org.apache.flink.configuration.Configuration config)
                                                                  throws Exception
        Creates a SSLHandlerFactory to be used by the REST Clients.
        Parameters:
        config - The application configuration.
        Throws:
        Exception
      • createRestSSLContext

        @Nullable
        @VisibleForTesting
        public static SSLContext createRestSSLContext​(org.apache.flink.configuration.Configuration config,
                                                      boolean clientMode)
                                               throws Exception
        Creates an SSL context for clients against the external REST endpoint.
        Throws:
        Exception
      • createRestNettySSLContext

        @Nullable
        public static org.apache.flink.shaded.netty4.io.netty.handler.ssl.SslContext createRestNettySSLContext​(org.apache.flink.configuration.Configuration config,
                                                                                                               boolean clientMode,
                                                                                                               org.apache.flink.shaded.netty4.io.netty.handler.ssl.ClientAuth clientAuth,
                                                                                                               org.apache.flink.shaded.netty4.io.netty.handler.ssl.SslProvider provider)
                                                                                                        throws Exception
        Creates an SSL context for the external REST SSL. If mutual authentication is configured the client and the server side configuration are identical.
        Throws:
        Exception