Class SSLPlugin

java.lang.Object
io.javalin.community.ssl.SSLPlugin
All Implemented Interfaces:
io.javalin.plugin.Plugin

public class SSLPlugin extends Object implements io.javalin.plugin.Plugin
A plugin to easily enable SSL on a Javalin server.

The intended configuration pattern is to use the SSLPlugin(Consumer) constructor to configure the plugin, either though a lambda or a Consumer. This allows for a more fluent configuration pattern.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new SSLPlugin with the default configuration.
    Creates a new SSLPlugin with the given configuration.
    Creates a new SSLPlugin with the given configuration lambda/supplier.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(io.javalin.Javalin javalin)
    Method to apply the plugin to a Javalin instance
    void
    patch(org.eclipse.jetty.server.Server server)
    Method to apply the SSLConfig to a given Jetty Server.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SSLPlugin

      public SSLPlugin()
      Creates a new SSLPlugin with the default configuration.
    • SSLPlugin

      public SSLPlugin(SSLConfig config)
      Creates a new SSLPlugin with the given configuration.
      Parameters:
      config - The configuration to use.
    • SSLPlugin

      public SSLPlugin(Consumer<SSLConfig> config)
      Creates a new SSLPlugin with the given configuration lambda/supplier. This is useful if you want to use the default configuration and only change a few values. Recommended way to create a new SSLPlugin with the given configuration.
      Parameters:
      config - The configuration to use.
  • Method Details

    • apply

      public void apply(@NotNull io.javalin.Javalin javalin)
      Method to apply the plugin to a Javalin instance
      Specified by:
      apply in interface io.javalin.plugin.Plugin
      Parameters:
      javalin - Javalin instance
    • patch

      public void patch(@NotNull org.eclipse.jetty.server.Server server)
      Method to apply the SSLConfig to a given Jetty Server. Can be used to patch pre-existing or custom servers.
      Parameters:
      server - The Jetty Server to patch.