@Requires(condition=io.micronaut.http.server.netty.ssl.SslEnabledCondition.class) @Requires(condition=io.micronaut.http.server.netty.ssl.CertificateProvidedSslBuilder.SelfSignedNotConfigured.class) @Singleton @Internal public class CertificateProvidedSslBuilder extends SslBuilder<io.netty.handler.ssl.SslContext> implements ServerSslBuilder, RefreshEventListener, Ordered
SslBuilder
that generates an SslContext
to create a server handle with
SSL support via user configuration.DEFAULT_POSITION
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
CertificateProvidedSslBuilder(HttpServerConfiguration httpServerConfiguration,
ServerSslConfiguration ssl,
ResourceResolver resourceResolver) |
Modifier and Type | Method and Description |
---|---|
Optional<io.netty.handler.ssl.SslContext> |
build() |
Optional<io.netty.handler.ssl.SslContext> |
build(SslConfiguration ssl) |
Optional<io.netty.handler.ssl.SslContext> |
build(SslConfiguration ssl,
HttpVersion httpVersion) |
protected Optional<KeyStore> |
getKeyStore(SslConfiguration ssl) |
Set<String> |
getObservedConfigurationPrefixes()
Returns the set of observed configuration prefixes that the event listener should listen for.
|
int |
getOrder() |
ServerSslConfiguration |
getSslConfiguration() |
protected Optional<KeyStore> |
getTrustStore(SslConfiguration ssl) |
void |
onApplicationEvent(RefreshEvent event)
Handle an application event.
|
getKeyManagerFactory, getTrustManagerFactory, load
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
supports
public CertificateProvidedSslBuilder(HttpServerConfiguration httpServerConfiguration, ServerSslConfiguration ssl, ResourceResolver resourceResolver)
httpServerConfiguration
- The HTTP server configurationssl
- The ssl configurationresourceResolver
- The resource resolverpublic ServerSslConfiguration getSslConfiguration()
getSslConfiguration
in interface ServerSslBuilder
public Optional<io.netty.handler.ssl.SslContext> build()
build
in interface ServerSslBuilder
public Optional<io.netty.handler.ssl.SslContext> build(SslConfiguration ssl)
build
in class SslBuilder<io.netty.handler.ssl.SslContext>
ssl
- The ssl configurationpublic Optional<io.netty.handler.ssl.SslContext> build(SslConfiguration ssl, HttpVersion httpVersion)
build
in class SslBuilder<io.netty.handler.ssl.SslContext>
ssl
- The ssl configurationhttpVersion
- The http versionprotected Optional<KeyStore> getTrustStore(SslConfiguration ssl) throws Exception
getTrustStore
in class SslBuilder<io.netty.handler.ssl.SslContext>
ssl
- The ssl configurationKeyStore
Exception
- if there is an errorprotected Optional<KeyStore> getKeyStore(SslConfiguration ssl) throws Exception
getKeyStore
in class SslBuilder<io.netty.handler.ssl.SslContext>
ssl
- The ssl configurationKeyStore
Exception
- if there is an errorpublic Set<String> getObservedConfigurationPrefixes()
RefreshEventListener
getObservedConfigurationPrefixes
in interface RefreshEventListener
public void onApplicationEvent(RefreshEvent event)
ApplicationEventListener
onApplicationEvent
in interface ApplicationEventListener<RefreshEvent>
event
- the event to respond topublic int getOrder()
getOrder
in interface Ordered
getOrder
in interface RefreshEventListener