Package org.jppf.ssl

Class SSLHelper

java.lang.Object
org.jppf.ssl.SSLHelper

public final class SSLHelper extends Object
Utility class handling all aspects of the SSL configuration.
Author:
Laurent Cohen
  • Constructor Details

    • SSLHelper

      public SSLHelper() throws Exception
      Instantiate this class with the default configuration.
      Throws:
      Exception
    • SSLHelper

      public SSLHelper(TypedProperties config) throws Exception
      Instantiate this class.
      Parameters:
      config - the configuration which contains the location or source of the SSL config.
      Throws:
      Exception
  • Method Details

    • getSSLContext

      public SSLContext getSSLContext(int identifier) throws Exception
      Get a SSL context from the SSL configuration.
      Parameters:
      identifier - identifies the type of channel for which to get the SSL context.
      Returns:
      a SSLContext instance.
      Throws:
      Exception - if any error occurs.
    • getSSLParameters

      public SSLParameters getSSLParameters() throws Exception
      Get SSL parameters from the configuration.
      Returns:
      a SSLParameters instance.
      Throws:
      Exception - if any error occurs.
    • createSSLClientConnection

      public SocketWrapper createSSLClientConnection(SocketWrapper socketClient) throws Exception
      Create an SSL connection over an established plain socket connection.
      Parameters:
      socketClient - the plain connection, already connected.
      Returns:
      a SocketWrapper whose socket is an SSLSocket wrapping the Socket of the plain connection.
      Throws:
      Exception - if an error occurs while configuring the SSL parameters.
    • configureJMXProperties

      public void configureJMXProperties(String protocol, Map<String,Object> env) throws Exception
      Configure the SSL environment parameters for a JMX connector server or client.
      Parameters:
      protocol - the JMX remote protocol to use.
      env - the environment in which to add the SSL/TLS properties.
      Throws:
      Exception - if any error occurs.
    • resetConfig

      public void resetConfig()
      Reset the SSL configuration.
    • getJPPFJMXremoteSSLHelper

      public static SSLHelper2 getJPPFJMXremoteSSLHelper(Map<String,?> env)
      Get an SSL context based on the configuration specified in the JMX environment map.
      Parameters:
      env - the env to get SSL proeprties from.
      Returns:
      an SSLHelper2 instance.