Package io.vertx.core.spi.tls
Class DefaultSslContextFactory
- java.lang.Object
-
- io.vertx.core.spi.tls.DefaultSslContextFactory
-
- All Implemented Interfaces:
SslContextFactory
public class DefaultSslContextFactory extends Object implements SslContextFactory
The default implementation ofSslContextFactory
that creates and configures a NettySslContext
using aSslContextBuilder
.- Author:
- Tim Fox, Julien Viet
-
-
Constructor Summary
Constructors Constructor Description DefaultSslContextFactory(SslProvider sslProvider, boolean sslSessionCacheEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SslContextFactory
applicationProtocols(List<String> applicationProtocols)
Set the application protocols to use when using ALPN.SslContextFactory
clientAuth(ClientAuth clientAuth)
Configures the client authSslContext
create()
SslContextFactory
enabledCipherSuites(Set<String> enabledCipherSuites)
Set the enabled cipher suites.SslContextFactory
forClient(boolean forClient)
Set whether to build a context for clients or for serversSslContextFactory
keyMananagerFactory(KeyManagerFactory kmf)
Set the key manager factory to use.SslContextFactory
trustManagerFactory(TrustManagerFactory tmf)
Set the trust manager factory to use.SslContextFactory
useAlpn(boolean useAlpn)
Set whether to use ALPN.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.vertx.core.spi.tls.SslContextFactory
serverName
-
-
-
-
Constructor Detail
-
DefaultSslContextFactory
public DefaultSslContextFactory(SslProvider sslProvider, boolean sslSessionCacheEnabled)
-
-
Method Detail
-
useAlpn
public SslContextFactory useAlpn(boolean useAlpn)
Description copied from interface:SslContextFactory
Set whether to use ALPN.- Specified by:
useAlpn
in interfaceSslContextFactory
- Parameters:
useAlpn
-true
to use ALPN- Returns:
- a reference to this, so the API can be used fluently
-
clientAuth
public SslContextFactory clientAuth(ClientAuth clientAuth)
Description copied from interface:SslContextFactory
Configures the client auth- Specified by:
clientAuth
in interfaceSslContextFactory
- Parameters:
clientAuth
- the client auth to use- Returns:
- a reference to this, so the API can be used fluently
-
forClient
public SslContextFactory forClient(boolean forClient)
Description copied from interface:SslContextFactory
Set whether to build a context for clients or for servers- Specified by:
forClient
in interfaceSslContextFactory
- Parameters:
forClient
-true
for client otherwise for servers- Returns:
- a reference to this, so the API can be used fluently
-
keyMananagerFactory
public SslContextFactory keyMananagerFactory(KeyManagerFactory kmf)
Description copied from interface:SslContextFactory
Set the key manager factory to use.- Specified by:
keyMananagerFactory
in interfaceSslContextFactory
- Parameters:
kmf
- the key manager factory instance- Returns:
- a reference to this, so the API can be used fluently
-
trustManagerFactory
public SslContextFactory trustManagerFactory(TrustManagerFactory tmf)
Description copied from interface:SslContextFactory
Set the trust manager factory to use.- Specified by:
trustManagerFactory
in interfaceSslContextFactory
- Parameters:
tmf
- the trust manager factory instance- Returns:
- a reference to this, so the API can be used fluently
-
create
public SslContext create() throws SSLException
- Specified by:
create
in interfaceSslContextFactory
- Returns:
- a configured
SslContext
- Throws:
SSLException
-
enabledCipherSuites
public SslContextFactory enabledCipherSuites(Set<String> enabledCipherSuites)
Description copied from interface:SslContextFactory
Set the enabled cipher suites.- Specified by:
enabledCipherSuites
in interfaceSslContextFactory
- Parameters:
enabledCipherSuites
- the set of cipher suites- Returns:
- a reference to this, so the API can be used fluently
-
applicationProtocols
public SslContextFactory applicationProtocols(List<String> applicationProtocols)
Description copied from interface:SslContextFactory
Set the application protocols to use when using ALPN.- Specified by:
applicationProtocols
in interfaceSslContextFactory
- Parameters:
applicationProtocols
- this list of application protocols- Returns:
- a reference to this, so the API can be used fluently
-
-