Top Inners Fields Constructors Methods
io.vertx.core.net.impl

public Class SSLHelper

extends Object
Class Inheritance
Imports
io.netty.buffer.ByteBufAllocator, .PooledByteBufAllocator, io.netty.handler.ssl.OpenSsl, .SslProvider, io.vertx.core.Future, .Promise, .VertxException, io.vertx.core.buffer.Buffer, io.vertx.core.buffer.impl.PartialPooledByteBufAllocator, io.vertx.core.http.ClientAuth, io.vertx.core.impl.ContextInternal, io.vertx.core.net.ClientOptionsBase, .JdkSSLEngineOptions, .KeyCertOptions, .NetClientOptions, .NetServerOptions, .OpenSSLEngineOptions, .SSLEngineOptions, .SSLOptions, .TCPSSLOptions, .TrustOptions, io.vertx.core.spi.tls.DefaultSslContextFactory, .SslContextFactory, javax.net.ssl.*, java.io.ByteArrayInputStream, java.security.cert.CRL, .CertificateFactory, java.util.*, java.util.concurrent.atomic.AtomicLong, java.util.function.Function, .Supplier, java.util.stream.Collectors

Authors
Tim Fox, Julien Viet

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private class

Field Summary

Modifier and TypeField and Description
private final List<String>
private Future<SSLHelper.CachedProvider>
private final boolean
pack-priv static final EnumMap<ClientAuth, ClientAuth>
private final ClientAuth
private List<CRL>
private final String
private KeyManagerFactory
private Function<String, KeyManagerFactory>
private static final AtomicLong
private final boolean
private final boolean
private final SSLEngineOptions
private final boolean
private TrustManagerFactory
private Function<String, TrustManager[]>
private final boolean

Constructor Summary

AccessConstructor and Description
public
SSLHelper(TCPSSLOptions options, List<String> applicationProtocols)

Method Summary

Modifier and TypeMethod and Description
private Future<SSLHelper.EngineConfig>

Returns:

a future resolved when the helper is initialized
build
(SSLOptions sslOptions, ContextInternal
the context
ctx
)

Initialize the helper, this loads and validates the configuration.

public Future<SslChannelProvider>

Returns:

a future resolved when the helper is initialized
buildChannelProvider
(SSLOptions sslOptions, ContextInternal
the context
ctx
)

Initialize the helper, this loads and validates the configuration.

public Future<SslContextProvider>

Returns:

a future resolved when the helper is initialized
buildContextProvider
(SSLOptions sslOptions, ContextInternal
the context
ctx
)

Initialize the helper, this loads and validates the configuration.

pack-priv ByteBufAllocator
public static SSLEngineOptions
resolveEngineOptions(SSLEngineOptions engineOptions, boolean useAlpn)

Resolve the ssl engine options to use for properly running the configured options.

pack-priv ByteBufAllocator
public synchronized int
public Future<SslContextUpdate>

Returns:

a future of the resolved channel provider
updateSslContext
(SSLOptions
the options to use
options
,
boolean force, ContextInternal
the vertx context
ctx
)

Update cached options.

private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

applicationProtocolsback to summary
private final List<String> applicationProtocols
cachedProviderback to summary
private Future<SSLHelper.CachedProvider> cachedProvider
clientback to summary
private final boolean client
CLIENT_AUTH_MAPPINGback to summary
pack-priv static final EnumMap<ClientAuth, ClientAuth> CLIENT_AUTH_MAPPING
clientAuthback to summary
private final ClientAuth clientAuth
crlsback to summary
private List<CRL> crls
endpointIdentificationAlgorithmback to summary
private final String endpointIdentificationAlgorithm
keyManagerFactoryback to summary
private KeyManagerFactory keyManagerFactory
keyManagerFactoryMapperback to summary
private Function<String, KeyManagerFactory> keyManagerFactoryMapper
seqback to summary
private static final AtomicLong seq
sniback to summary
private final boolean sni
sslback to summary
private final boolean ssl
sslEngineOptionsback to summary
private final SSLEngineOptions sslEngineOptions
trustAllback to summary
private final boolean trustAll
trustManagerFactoryback to summary
private TrustManagerFactory trustManagerFactory
trustManagerMapperback to summary
private Function<String, TrustManager[]> trustManagerMapper
useAlpnback to summary
private final boolean useAlpn

Constructor Detail

SSLHelperback to summary
public SSLHelper(TCPSSLOptions options, List<String> applicationProtocols)

Method Detail

buildback to summary
private Future<SSLHelper.EngineConfig> build(SSLOptions sslOptions, ContextInternal ctx)

Initialize the helper, this loads and validates the configuration.

Parameters
ctx:ContextInternal

the context

Returns:Future<SSLHelper.EngineConfig>

a future resolved when the helper is initialized

buildChannelProviderback to summary
public Future<SslChannelProvider> buildChannelProvider(SSLOptions sslOptions, ContextInternal ctx)

Initialize the helper, this loads and validates the configuration.

Parameters
ctx:ContextInternal

the context

Returns:Future<SslChannelProvider>

a future resolved when the helper is initialized

buildContextProviderback to summary
public Future<SslContextProvider> buildContextProvider(SSLOptions sslOptions, ContextInternal ctx)

Initialize the helper, this loads and validates the configuration.

Parameters
ctx:ContextInternal

the context

Returns:Future<SslContextProvider>

a future resolved when the helper is initialized

clientByteBufAllocatorback to summary
pack-priv ByteBufAllocator clientByteBufAllocator(SslContextProvider ctxProvider)
resolveEngineOptionsback to summary
public static SSLEngineOptions resolveEngineOptions(SSLEngineOptions engineOptions, boolean useAlpn)

Resolve the ssl engine options to use for properly running the configured options.

serverByteBufAllocatorback to summary
pack-priv ByteBufAllocator serverByteBufAllocator(SslContextProvider ctxProvider)
sniEntrySizeback to summary
public synchronized int sniEntrySize()
updateSslContextback to summary
public Future<SslContextUpdate> updateSslContext(SSLOptions options, boolean force, ContextInternal ctx)

Update cached options. This method ensures updates are serialized a nd performed when options is different (based on equals). Updates only happen when transforming options to a SslChannelProvider succeeds.

Parameters
options:SSLOptions

the options to use

ctx:ContextInternal

the vertx context

Returns:Future<SslContextUpdate>

a future of the resolved channel provider

usesJDKSSLWithPooledHeapBuffersback to summary
private boolean usesJDKSSLWithPooledHeapBuffers(SslContextProvider ctxProvider)
io.vertx.core.net.impl back to summary

private Class SSLHelper.CachedProvider

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final Throwable
pack-priv final long
pack-priv final SSLOptions
pack-priv final SslChannelProvider

Constructor Summary

AccessConstructor and Description
pack-priv
CachedProvider(SSLOptions options, long id, SslChannelProvider sslChannelProvider, Throwable failure)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

failureback to summary
pack-priv final Throwable failure
idback to summary
pack-priv final long id
optionsback to summary
pack-priv final SSLOptions options
sslChannelProviderback to summary
pack-priv final SslChannelProvider sslChannelProvider

Constructor Detail

CachedProviderback to summary
pack-priv CachedProvider(SSLOptions options, long id, SslChannelProvider sslChannelProvider, Throwable failure)
io.vertx.core.net.impl back to summary

private Class SSLHelper.EngineConfig

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final boolean
private final SSLOptions
private final Supplier<SslContextFactory>
private final boolean

Constructor Summary

AccessConstructor and Description
public
EngineConfig(boolean jdkSSLProvider, SSLOptions sslOptions, Supplier<SslContextFactory> supplier, boolean useWorkerPool)

Method Summary

Modifier and TypeMethod and Description
pack-priv SslContextProvider
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

jdkSSLProviderback to summary
private final boolean jdkSSLProvider
sslOptionsback to summary
private final SSLOptions sslOptions
supplierback to summary
private final Supplier<SslContextFactory> supplier
useWorkerPoolback to summary
private final boolean useWorkerPool

Constructor Detail

EngineConfigback to summary
public EngineConfig(boolean jdkSSLProvider, SSLOptions sslOptions, Supplier<SslContextFactory> supplier, boolean useWorkerPool)

Method Detail

sslContextProviderback to summary
pack-priv SslContextProvider sslContextProvider()