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

public Class SslContextProvider

extends Object
Class Inheritance
Imports
io.netty.handler.ssl.SslContext, io.vertx.core.VertxException, io.vertx.core.http.ClientAuth, io.vertx.core.spi.tls.SslContextFactory, javax.net.ssl.*, java.security.cert.CRL, .CertificateException, .X509Certificate, java.util.*, java.util.function.Function, .Supplier

Provides Netty's SslContext.
Author
Julien Viet

Field Summary

Modifier and TypeField and Description
private final List<String>
private final ClientAuth
private final List<CRL>
private final Set<String>
private final Set<String>
private final String
private final boolean
private final KeyManagerFactory
private final Function<String, KeyManagerFactory>
private final Supplier<SslContextFactory>
private static final TrustManager
private final TrustManagerFactory
private final Function<String, TrustManager[]>

Constructor Summary

AccessConstructor and Description
public
SslContextProvider(boolean jdkSSLProvider, ClientAuth clientAuth, String endpointIdentificationAlgorithm, List<String> applicationProtocols, Set<String> enabledCipherSuites, Set<String> enabledProtocols, KeyManagerFactory keyManagerFactory, Function<String, KeyManagerFactory> keyManagerFactoryMapper, TrustManagerFactory trustManagerFactory, Function<String, TrustManager[]> trustManagerMapper, List<CRL> crls, Supplier<SslContextFactory> provider)

Method Summary

Modifier and TypeMethod and Description
private VertxTrustManagerFactory
public void
configureEngine(SSLEngine engine, Set<String> enabledProtocols, String serverName, boolean client)

public VertxSslContext
createClientContext(KeyManagerFactory keyManagerFactory, TrustManager[] trustManagers, String serverName, boolean useAlpn)

public VertxSslContext
createContext(boolean server, KeyManagerFactory keyManagerFactory, TrustManager[] trustManagers, String serverName, boolean useAlpn, boolean trustAll)

public VertxSslContext
createContext(boolean server, boolean useAlpn)

public VertxSslContext
createServerContext(KeyManagerFactory keyManagerFactory, TrustManager[] trustManagers, String serverName, boolean useAlpn)

private static TrustManager[]
private static TrustManager[]
public KeyManagerFactory
public TrustManagerFactory
public TrustManager[]
pack-priv boolean
public KeyManagerFactory

Returns:

the factory
resolveKeyManagerFactory
(String
the server name
serverName
)

Resolve the KeyManagerFactory for the serverName, when a factory cannot be resolved, null is returned.

public TrustManager[]

Returns:

the managers
resolveTrustManagers
(String
the server name
serverName
)

Resolve the TrustManager[] for the serverName, when managers cannot be resolved, null is returned.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

applicationProtocolsback to summary
private final List<String> applicationProtocols
clientAuthback to summary
private final ClientAuth clientAuth
crlsback to summary
private final List<CRL> crls
enabledCipherSuitesback to summary
private final Set<String> enabledCipherSuites
enabledProtocolsback to summary
private final Set<String> enabledProtocols
endpointIdentificationAlgorithmback to summary
private final String endpointIdentificationAlgorithm
jdkSSLProviderback to summary
private final boolean jdkSSLProvider
keyManagerFactoryback to summary
private final KeyManagerFactory keyManagerFactory
keyManagerFactoryMapperback to summary
private final Function<String, KeyManagerFactory> keyManagerFactoryMapper
providerback to summary
private final Supplier<SslContextFactory> provider
TRUST_ALL_MANAGERback to summary
private static final TrustManager TRUST_ALL_MANAGER
trustManagerFactoryback to summary
private final TrustManagerFactory trustManagerFactory
trustManagerMapperback to summary
private final Function<String, TrustManager[]> trustManagerMapper

Constructor Detail

SslContextProviderback to summary
public SslContextProvider(boolean jdkSSLProvider, ClientAuth clientAuth, String endpointIdentificationAlgorithm, List<String> applicationProtocols, Set<String> enabledCipherSuites, Set<String> enabledProtocols, KeyManagerFactory keyManagerFactory, Function<String, KeyManagerFactory> keyManagerFactoryMapper, TrustManagerFactory trustManagerFactory, Function<String, TrustManager[]> trustManagerMapper, List<CRL> crls, Supplier<SslContextFactory> provider)

Method Detail

buildVertxTrustManagerFactoryback to summary
private VertxTrustManagerFactory buildVertxTrustManagerFactory(TrustManager[] mgrs)
configureEngineback to summary
public void configureEngine(SSLEngine engine, Set<String> enabledProtocols, String serverName, boolean client)
createClientContextback to summary
public VertxSslContext createClientContext(KeyManagerFactory keyManagerFactory, TrustManager[] trustManagers, String serverName, boolean useAlpn)
createContextback to summary
public VertxSslContext createContext(boolean server, KeyManagerFactory keyManagerFactory, TrustManager[] trustManagers, String serverName, boolean useAlpn, boolean trustAll)
createContextback to summary
public VertxSslContext createContext(boolean server, boolean useAlpn)
createServerContextback to summary
public VertxSslContext createServerContext(KeyManagerFactory keyManagerFactory, TrustManager[] trustManagers, String serverName, boolean useAlpn)
createTrustAllManagerback to summary
private static TrustManager[] createTrustAllManager()
createUntrustRevokedCertTrustManagerback to summary
private static TrustManager[] createUntrustRevokedCertTrustManager(TrustManager[] trustMgrs, List<CRL> crls)
defaultKeyManagerFactoryback to summary
public KeyManagerFactory defaultKeyManagerFactory()
defaultTrustManagerFactoryback to summary
public TrustManagerFactory defaultTrustManagerFactory()
defaultTrustManagersback to summary
public TrustManager[] defaultTrustManagers()
jdkSSLProviderback to summary
pack-priv boolean jdkSSLProvider()
resolveKeyManagerFactoryback to summary
public KeyManagerFactory resolveKeyManagerFactory(String serverName) throws Exception

Resolve the KeyManagerFactory for the serverName, when a factory cannot be resolved, null is returned.
This can block and should be executed on the appropriate thread.

Parameters
serverName:String

the server name

Returns:KeyManagerFactory

the factory

Exceptions
Exception:
anything that would prevent loading the factory
resolveTrustManagersback to summary
public TrustManager[] resolveTrustManagers(String serverName) throws Exception

Resolve the TrustManager[] for the serverName, when managers cannot be resolved, null is returned.
This can block and should be executed on the appropriate thread.

Parameters
serverName:String

the server name

Returns:TrustManager[]

the managers

Exceptions
Exception:
anything that would prevent loading the managers