SSLConf (Apache Tomcat 9.0.120 API Documentation)
Description: declaration: package: org.apache.tomcat.jni, class: SSLConf

# Class SSLConf

java.lang.Object
org.apache.tomcat.jni.SSLConf

public final class SSLConf extends Object
JNI bindings for OpenSSL SSL_CONF operations.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SSLConf()`
  Default constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static int`
  `apply(long cctx, String name, String value)`
  Apply a command to an SSL_CONF context.
  `static void`
  `assign(long cctx, long ctx)`
  Assign an SSL context to an SSL_CONF context.
  `static int`
  `check(long cctx, String name, String value)`
  Optionally used to check a command with an SSL_CONF context.
  `static int`
  `finish(long cctx)`
  Finish commands for an SSL_CONF context.
  `static void`
  `free(long cctx)`
  Free the resources used by the context
  `static long`
  `make(long pool, int flags)`
  Create a new SSL_CONF context.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SSLConf

    public SSLConf()
    Default constructor. This class provides only static methods.

- ## Method Details

  - ### make

    public static long make(long pool, int flags) throws Exception
    Create a new SSL_CONF context.
    Parameters:
      `pool` - The pool to use.
      `flags` - The SSL_CONF flags to use. It can be any combination of the following:

          SSL.SSL_CONF_FLAG_CMDLINE
          SSL.SSL_CONF_FLAG_FILE
          SSL.SSL_CONF_FLAG_CLIENT
          SSL.SSL_CONF_FLAG_SERVER
          SSL.SSL_CONF_FLAG_SHOW_ERRORS
          SSL.SSL_CONF_FLAG_CERTIFICATE

    Returns:
      The Java representation of a pointer to the newly created SSL_CONF Context
    Throws:
      `Exception` - If the SSL_CONF context could not be created
    See Also:
      - OpenSSL SSL_CONF_CTX_new
      - OpenSSL SSL_CONF_CTX_set_flags

  - ### free

    public static void free(long cctx)
    Free the resources used by the context
    Parameters:
      `cctx` - SSL_CONF context to free.
    See Also:
      - OpenSSL SSL_CONF_CTX_free

  - ### check

    public static int check(long cctx, String name, String value) throws Exception
    Optionally used to check a command with an SSL_CONF context.

    This call is also used to pass Tomcat specific settings to Tomcat Native. It must be called for for each Tomcat specific setting (e.g. `OpenSSLConfCmd.NO_OCSP_CHECK`) before `assign(long, long)` is called.

    Parameters:
      `cctx` - SSL_CONF context to use.
      `name` - command name.
      `value` - command value.
    Returns:
      The result of the check based on the `SSL_CONF_cmd_value_type` call. Unknown types will result in an exception, as well as file and directory types with invalid file or directory names.
    Throws:
      `Exception` - If the check fails.
    See Also:
      - OpenSSL SSL_CONF_cmd_value_type

  - ### assign

    public static void assign(long cctx, long ctx)
    Assign an SSL context to an SSL_CONF context. All following calls to `apply(long, String, String)` will be applied to this SSL context.

    For Tomcat specific settings this call applies previous settings set via calls to `check(long, String, String)`. Further calls to `check(long, String, String)` after a call to this method will have no effect.

    Parameters:
      `cctx` - SSL_CONF context to use.
      `ctx` - SSL context to assign to the given SSL_CONF context.
    See Also:
      - OpenSSL SSL_CONF_CTX_set_ssl_ctx

  - ### apply

    public static int apply(long cctx, String name, String value) throws Exception
    Apply a command to an SSL_CONF context.

    This call has no effect for Tomcat specific settings.

    Parameters:
      `cctx` - SSL_CONF context to use.
      `name` - command name.
      `value` - command value.
    Returns:
      The result of the native `SSL_CONF_cmd` call
    Throws:
      `Exception` - If the SSL_CONF context is `0`
    See Also:
      - OpenSSL SSL_CONF_cmd

  - ### finish

    public static int finish(long cctx)
    Finish commands for an SSL_CONF context.

    This call has no effect for Tomcat specific settings.

    Parameters:
      `cctx` - SSL_CONF context to use.
    Returns:
      The result of the native `SSL_CONF_CTX_finish` call
    See Also:
      - OpenSSL SSL_CONF_CTX_finish