Class AbstractServerSslBuilder

java.lang.Object
io.micronaut.http.ssl.SslBuilder<io.netty.handler.ssl.SslContext>
io.micronaut.http.server.netty.ssl.AbstractServerSslBuilder
All Implemented Interfaces:
ServerSslBuilder
Direct Known Subclasses:
CertificateProvidedSslBuilder, SelfSignedSslBuilder

public abstract class AbstractServerSslBuilder extends SslBuilder<io.netty.handler.ssl.SslContext> implements ServerSslBuilder
Base class for ServerSslBuilder implementations. This class implements the various build methods for ServerSslBuilder and SslBuilder using SslBuilder.getTrustManagerFactory(io.micronaut.http.ssl.SslConfiguration) and getKeyManagerFactory(io.micronaut.http.ssl.SslConfiguration). Subclasses can override those methods with their own implementation that will be called on each ssl context build.
Since:
4.0.0
Author:
Jonas Konrad
  • Constructor Details

    • AbstractServerSslBuilder

      public AbstractServerSslBuilder(ResourceResolver resourceResolver, HttpServerConfiguration httpServerConfiguration)
      Create a new server SSL builder.
      Parameters:
      resourceResolver - Resource resolver for default key/trust store loading implementation
      httpServerConfiguration - Server configuration for determining HTTP version
  • Method Details

    • build

      public final Optional<io.netty.handler.ssl.SslContext> build()
      Specified by:
      build in interface ServerSslBuilder
      Returns:
      Builds the SSL configuration wrapped inside an optional
    • build

      public final Optional<io.netty.handler.ssl.SslContext> build(SslConfiguration ssl)
      Specified by:
      build in class SslBuilder<io.netty.handler.ssl.SslContext>
      Parameters:
      ssl - The ssl configuration
      Returns:
      Builds the SSL configuration wrapped inside an optional
    • build

      public final Optional<io.netty.handler.ssl.SslContext> build(SslConfiguration ssl, HttpVersion httpVersion)
      Specified by:
      build in class SslBuilder<io.netty.handler.ssl.SslContext>
      Parameters:
      ssl - The ssl configuration
      httpVersion - The http version
      Returns:
      Builds the SSL configuration wrapped inside an optional
    • processBuilder

      protected void processBuilder(@NonNull @NonNull io.netty.handler.ssl.SslContextBuilder sslBuilder, @NonNull @NonNull SslConfiguration ssl, @NonNull @NonNull HttpVersion httpVersion)
      Post-process the context builder. This is used by the ACME ALPN challenge. Note that this is not called for QUIC, so it should only be used sparingly.
      Parameters:
      sslBuilder - The ssl context builder to post-process
      ssl - The ssl configuration
      httpVersion - The http version
    • buildQuic

      public final Optional<io.netty.incubator.codec.quic.QuicSslContext> buildQuic()
      Specified by:
      buildQuic in interface ServerSslBuilder
    • getKeyManagerFactory

      protected KeyManagerFactory getKeyManagerFactory(SslConfiguration ssl)
      Overrides:
      getKeyManagerFactory in class SslBuilder<io.netty.handler.ssl.SslContext>
      Parameters:
      ssl - The ssl configuration
      Returns:
      The KeyManagerFactory