Class SSLConfig

java.lang.Object
io.javalin.community.ssl.SSLConfig

public class SSLConfig extends Object
Data class to hold the configuration for the plugin.
  • Field Details

    • host

      public String host
      Host to bind to.
    • insecure

      public boolean insecure
      Toggle the default http (insecure) connector.
    • secure

      public boolean secure
      Toggle the default https (secure) connector.
    • securePort

      public int securePort
      Port to use on the SSL (secure) connector.
    • insecurePort

      public int insecurePort
      Port to use on the http (insecure) connector.
    • redirect

      public boolean redirect
      Enable http to https redirection.
    • http2

      public boolean http2
      Toggle HTTP/2 Support
    • sniHostCheck

      public boolean sniHostCheck
      Disable SNI checks.
      See Also:
    • tlsConfig

      public TLSConfig tlsConfig
      TLS Security configuration
    • enableHttp3

      public final boolean enableHttp3
      Enables HTTP/3 Support. Disabled by default because it is not yet working on Jetty.
      See Also:
    • disableHttp3Upgrade

      public final boolean disableHttp3Upgrade
      Disables the handler that adds an "Alt-Svc" header to any non HTTP/3 response. Disabled by default because it is not yet working on Jetty.
      See Also:
    • http3Port

      public final int http3Port
      UDP Port to use on the HTTP/3 connector. Disabled by default because it is not yet working on Jetty.
      See Also:
    • inner

      public SSLConfig.InnerConfig inner
    • configConnectors

      @Deprecated(forRemoval=true, since="5.3.2") public Consumer<org.eclipse.jetty.server.ServerConnector> configConnectors
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use configConnectors(Consumer<ServerConnector>) instead, access modifier will be changed to private in the next major release.
      Consumer to configure the different ServerConnector that will be created. This consumer will be called as the last config step for each connector, allowing to override any previous configuration.
    • securityProvider

      public Provider securityProvider
      Security provider to use for the SSLContext.
  • Constructor Details

    • SSLConfig

      public SSLConfig()
  • Method Details

    • pemFromPath

      public void pemFromPath(String certificatePath, String privateKeyPath)
      Load pem formatted identity data from a given path in the system.
      Parameters:
      certificatePath - path to the certificate chain PEM file.
      privateKeyPath - path to the private key PEM file.
    • pemFromPath

      public void pemFromPath(String certificatePath, String privateKeyPath, String privateKeyPassword)
      Load pem formatted identity data from a given path in the system.
      Parameters:
      certificatePath - path to the certificate chain PEM file.
      privateKeyPath - path to the private key PEM file.
      privateKeyPassword - password for the private key.
    • pemFromClasspath

      public void pemFromClasspath(String certificateFile, String privateKeyFile)
      Load pem formatted identity data from the classpath.
      Parameters:
      certificateFile - The name of the pem certificate file in the classpath.
      privateKeyFile - The name of the pem private key file in the classpath.
    • pemFromClasspath

      public void pemFromClasspath(String certificateFile, String privateKeyFile, String privateKeyPassword)
      Load pem formatted identity data from the classpath.
      Parameters:
      certificateFile - The name of the pem certificate file in the classpath.
      privateKeyFile - The name of the pem private key file in the classpath.
      privateKeyPassword - password for the private key.
    • pemFromInputStream

      public void pemFromInputStream(InputStream certificateInputStream, InputStream privateKeyInputStream)
      Load pem formatted identity data from a given input stream.
      Parameters:
      certificateInputStream - input stream to the certificate chain PEM file.
      privateKeyInputStream - input stream to the private key PEM file.
    • pemFromInputStream

      public void pemFromInputStream(InputStream certificateInputStream, InputStream privateKeyInputStream, String privateKeyPassword)
      Load pem formatted identity data from a given input stream.
      Parameters:
      certificateInputStream - input stream to the certificate chain PEM file.
      privateKeyInputStream - input stream to the private key PEM file.
      privateKeyPassword - password for the private key.
    • pemFromString

      public void pemFromString(String certificateString, String privateKeyString)
      Load pem formatted identity data from a given string.
      Parameters:
      certificateString - PEM encoded certificate chain.
      privateKeyString - PEM encoded private key.
    • pemFromString

      public void pemFromString(String certificateString, String privateKeyString, String privateKeyPassword)
      Load pem formatted identity data from a given string.
      Parameters:
      certificateString - PEM encoded certificate chain.
      privateKeyString - PEM encoded private key.
      privateKeyPassword - password for the private key.
    • keystoreFromPath

      public void keystoreFromPath(String keyStorePath, String keyStorePassword)
      Load a key store from a given path in the system.
      Parameters:
      keyStorePath - path to the key store file.
      keyStorePassword - password for the key store.
    • keystoreFromInputStream

      public void keystoreFromInputStream(InputStream keyStoreInputStream, String keyStorePassword)
      Load a key store from a given input stream.
      Parameters:
      keyStoreInputStream - input stream to the key store file.
      keyStorePassword - password for the key store.
    • keystoreFromClasspath

      public void keystoreFromClasspath(String keyStoreFile, String keyStorePassword)
      Load a key store from the classpath.
      Parameters:
      keyStoreFile - name of the key store file in the classpath.
      keyStorePassword - password for the key store.
    • configConnectors

      public void configConnectors(Consumer<org.eclipse.jetty.server.ServerConnector> configConnectors)
      Consumer to configure the different ServerConnector that will be created. This consumer will be called as the last config step for each connector, allowing to override any previous configuration.
    • withTrustConfig

      public void withTrustConfig(Consumer<TrustConfig> trustConfigConsumer)
      Trust configuration as a consumer.
      Parameters:
      trustConfigConsumer - consumer to configure the trust configuration.