Class SslSettings

java.lang.Object
eu.mrapik.minecraftservermcp.config.SslSettings

public final class SslSettings extends Object
Optional TLS (HTTPS) listener for the embedded MCP server. When enabled() is false, no SSL connector is started and clients use plain HTTP on PluginSettings.port().
  • Method Details

    • load

      public static SslSettings load(JavaPlugin plugin, FileConfiguration c, int httpPort)
      Parses the ssl section. Relative keystorePath values are resolved under the plugin data folder.
      Parameters:
      plugin - owning plugin (data folder for relative keystore paths)
      c - root plugin configuration (reads ssl section)
      httpPort - plain HTTP port; must differ from SSL port when SSL is enabled
      Returns:
      disabled settings when the section is absent or enabled is false; otherwise validated TLS settings
    • disabled

      public static SslSettings disabled()
      Returns settings with enabled() false (no connector created).
      Returns:
      disabled SSL configuration
    • enabled

      public boolean enabled()
      Whether the MCP plugin should open an HTTPS connector.
      Returns:
      true when ssl.enabled was set in config
    • port

      public int port()
      TLS listen port (separate from PluginSettings.port()).
      Returns:
      TCP port for HTTPS when enabled() is true
    • keystorePath

      public String keystorePath()
      Absolute path to the keystore file (JKS or PKCS12).
      Returns:
      filesystem path when enabled() is true
    • keystoreType

      public String keystoreType()
      Java KeyStore type (e.g. PKCS12 or JKS).
      Returns:
      keystore type string
    • keystorePassword

      public String keystorePassword()
      Password for the keystore file.
      Returns:
      keystore password string
    • keyPassword

      @Nullable public @Nullable String keyPassword()
      Key password when it differs from the keystore password; may be null to use the keystore password.
      Returns:
      optional key password