Package org.jppf.ssl

Class SSLHelper2

java.lang.Object
org.jppf.ssl.SSLHelper2

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

    • SSLHelper2

      public SSLHelper2(TypedProperties sslConfig)
      Parameters:
      sslConfig - the SSL configuration.
  • Method Details

    • getSSLContext

      public SSLContext getSSLContext(int identifier) throws SSLConfigurationException
      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:
      SSLConfigurationException - 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.
    • getClientConfigId

      public static String getClientConfigId(String driverName)
      Get the ssl configuration id for the specified driver name in the client configuration.
      Parameters:
      driverName - the name of the driver to build the id for.
      Returns:
      an id composed of a property name and its value, in the form "driverName.property_suffix=value".
    • dumpSSLParameters

      public static String dumpSSLParameters(SSLParameters params)
      Print the specified SSL parameters into a string.
      Parameters:
      params - the parameters to print.
      Returns:
      a formatted string describing the SSL parameters.