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 Summary
ConstructorDescriptionAbstractServerSslBuilder
(ResourceResolver resourceResolver, HttpServerConfiguration httpServerConfiguration) Create a new server SSL builder. -
Method Summary
Modifier and TypeMethodDescriptionfinal Optional<io.netty.handler.ssl.SslContext>
build()
final Optional<io.netty.handler.ssl.SslContext>
build
(SslConfiguration ssl) final Optional<io.netty.handler.ssl.SslContext>
build
(SslConfiguration ssl, HttpVersion httpVersion) final Optional<io.netty.incubator.codec.quic.QuicSslContext>
protected KeyManagerFactory
protected void
processBuilder
(@NonNull io.netty.handler.ssl.SslContextBuilder sslBuilder, @NonNull SslConfiguration ssl, @NonNull HttpVersion httpVersion) Post-process the context builder.Methods inherited from class io.micronaut.http.ssl.SslBuilder
getKeyStore, getTrustManagerFactory, getTrustManagerFactory, getTrustStore, load
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.http.server.netty.ssl.ServerSslBuilder
getSslConfiguration
-
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 implementationhttpServerConfiguration
- Server configuration for determining HTTP version
-
-
Method Details
-
build
- Specified by:
build
in interfaceServerSslBuilder
- Returns:
- Builds the SSL configuration wrapped inside an optional
-
build
- Specified by:
build
in classSslBuilder<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 classSslBuilder<io.netty.handler.ssl.SslContext>
- Parameters:
ssl
- The ssl configurationhttpVersion
- 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-processssl
- The ssl configurationhttpVersion
- The http version
-
buildQuic
- Specified by:
buildQuic
in interfaceServerSslBuilder
-
getKeyManagerFactory
- Overrides:
getKeyManagerFactory
in classSslBuilder<io.netty.handler.ssl.SslContext>
- Parameters:
ssl
- The ssl configuration- Returns:
- The
KeyManagerFactory
-