Package ghidra.net

# Class SSLContextInitializer

java.lang.Object
ghidra.net.SSLContextInitializer

All Implemented Interfaces:
  `ModuleInitializer`, `ExtensionPoint`, `Runnable`

public class SSLContextInitializer extends Object implements ModuleInitializer
Initialize the default SSLContext for use by all SSL connections (e.g., https). It is the responsibility of the Application to properly invoke this initializer to ensure that the default SSLContext is properly established. While HTTPS URL connections will make use of this default SSLContext, other SSL connections may need to specify the `ApplicationSSLSocketFactory` to leverage the applications default SSLContext.

The property `jdk.tls.client.protocols` should be set to restrict secure client connections to a specific set of enabled TLS protocols (e.g., TLSv1.2,TLSv1.3). See JDK and JRE Cryptographic Algorithms for details.

See Also:
  - `ApplicationTrustManagerFactory`
  - `ApplicationKeyManagerFactory`
  - `ApplicationKeyManagerUtils`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `SSLContextInitializer.HttpsHostnameVerifier`
  `HttpsHostnameVerifier` is required by HttpsURLConnection even if it does nothing.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SSLContextInitializer()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getName()`
  `static boolean`
  `initialize()`
  Initialize default SSLContext
  `static boolean`
  `initialize(boolean reset)`
  Initialize default SSLContext with optional reset.
  `void`
  `run()`

  ### Methods inherited from class java.lang.Object

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

- ## Constructor Details

  - ### SSLContextInitializer

    public SSLContextInitializer()

- ## Method Details

  - ### initialize

    public static boolean initialize(boolean reset)
    Initialize default SSLContext with optional reset. This method is primarily intended for testing.
    Parameters:
      `reset` - if true a complete reset will be done to force use of any new certificate or keystores previously used.
    Returns:
      true if successful, else false (see logged error)

  - ### initialize

    public static boolean initialize()
    Initialize default SSLContext
    Returns:
      true if successful, else false (see logged error)

  - ### run

    public void run()
    Specified by:
      `run` in interface `Runnable`

  - ### getName

    public String getName()
    Specified by:
      `getName` in interface `ModuleInitializer`
    Returns:
      initializer name