Top Description Fields Constructors Methods
io.netty5.handler.ssl

public abstract Class SslContext

extends Object
Class Inheritance
Known Direct Subclasses
io.netty5.handler.ssl.DelegatingSslContext, io.netty5.handler.ssl.JdkSslContext, io.netty5.handler.ssl.ReferenceCountedOpenSslContext
Imports
io.netty5.buffer.BufferInputStream, .Buffer, .BufferAllocator, io.netty5.channel.ChannelInitializer, .ChannelPipeline, io.netty5.handler.ssl.ApplicationProtocolConfig.Protocol, .ApplicationProtocolConfig.SelectedListenerFailureBehavior, .ApplicationProtocolConfig.SelectorFailureBehavior, io.netty5.util.AttributeMap, .DefaultAttributeMap, io.netty5.util.internal.EmptyArrays, javax.crypto.Cipher, .EncryptedPrivateKeyInfo, .NoSuchPaddingException, .SecretKey, .SecretKeyFactory, javax.crypto.spec.PBEKeySpec, javax.net.ssl.KeyManager, .KeyManagerFactory, .SSLContext, .SSLEngine, .SSLException, .SSLSessionContext, .TrustManager, .TrustManagerFactory, java.io.File, .BufferedInputStream, .IOException, .InputStream, .UncheckedIOException, java.security.InvalidAlgorithmParameterException, .InvalidKeyException, .KeyException, .KeyFactory, .KeyStore, .KeyStoreException, .NoSuchAlgorithmException, .PrivateKey, .Provider, .UnrecoverableKeyException, java.security.cert.CertificateException, .CertificateFactory, .X509Certificate, java.security.spec.InvalidKeySpecException, .PKCS8EncodedKeySpec, java.util.List, .Map, java.util.concurrent.Executor

A secure socket protocol implementation which acts as a factory for SSLEngine and SslHandler. Internally, it is implemented via JDK's SSLContext or OpenSSL's SSL_CTX.

Making your server support SSL/TLS

// In your ChannelInitializer:
ChannelPipeline p = channel.pipeline();
SslContext sslCtx = SslContextBuilder.forServer(...).build();
p.addLast("ssl", sslCtx.newHandler(channel.alloc()));
...

Making your client support SSL/TLS

// In your ChannelInitializer:
ChannelPipeline p = channel.pipeline();
SslContext sslCtx = SslContextBuilder.forClient().build();
p.addLast("ssl", sslCtx.newHandler(channel.alloc(), host, port));
...

Field Summary

Modifier and TypeField and Description
pack-priv static final String
private final AttributeMap
private final boolean
pack-priv static final CertificateFactory

Constructor Summary

AccessConstructor and Description
protected
SslContext()

Creates a new instance (startTls set to false).

protected
SslContext(boolean startTls)

Creates a new instance.

Method Summary

Modifier and TypeMethod and Description
public abstract ApplicationProtocolNegotiator
applicationProtocolNegotiator()

Deprecated as a consequence of ApplicationProtocolNegotiator being deprecated.
Returns the object responsible for negotiating application layer protocols for the TLS NPN/ALPN extensions.
public final AttributeMap
attributes()

Returns the AttributeMap that belongs to this SslContext .

protected static KeyManagerFactory
buildKeyManagerFactory(X509Certificate[] certChainFile, String keyAlgorithm, PrivateKey key, String keyPassword, KeyManagerFactory kmf, String keyStore)

pack-priv static KeyManagerFactory
buildKeyManagerFactory(KeyStore ks, String keyAlgorithm, char[] keyPasswordChars, KeyManagerFactory kmf)

protected static KeyStore

Returns:

generated KeyStore.
buildKeyStore
(X509Certificate[]
an X.509 certificate chain
certChain
,
PrivateKey
a PKCS#8 private key
key
,
char[]
the password of the keyFile. null if it's not password-protected.
keyPasswordChars
,
String
The KeyStore Type you want to use
keyStoreType
)

Generates a new KeyStore.

protected static TrustManagerFactory

Returns:

A TrustManagerFactory which contains the certificates in certChainFile
buildTrustManagerFactory
(File
The certificate file to build from.
certChainFile
,
TrustManagerFactory
The existing TrustManagerFactory that will be used if not null.
trustManagerFactory
)

Deprecated
Build a TrustManagerFactory from a certificate chain file.
protected static TrustManagerFactory

Returns:

A TrustManagerFactory which contains the certificates in certChainFile
buildTrustManagerFactory
(File
The certificate file to build from.
certChainFile
,
TrustManagerFactory
The existing TrustManagerFactory that will be used if not null.
trustManagerFactory
,
String
The KeyStore Type you want to use
keyType
)

Build a TrustManagerFactory from a certificate chain file.

protected static TrustManagerFactory
buildTrustManagerFactory(X509Certificate[] certCollection, TrustManagerFactory trustManagerFactory, String keyStoreType)

public abstract List<String>
cipherSuites()

Returns the list of enabled cipher suites, in the order of preference.

public static SslProvider

Returns:

SslProvider#OPENSSL if OpenSSL is available. SslProvider#JDK otherwise.
defaultClientProvider
()

Returns the default client-side implementation provider currently in use.

private static SslProvider
public static SslProvider

Returns:

SslProvider#OPENSSL if OpenSSL is available. SslProvider#JDK otherwise.
defaultServerProvider
()

Returns the default server-side implementation provider currently in use.

protected static PKCS8EncodedKeySpec

Returns:

a key specification
generateKeySpec
(char[]
characters, if null an unencrypted key is assumed
password
,
byte[]
bytes of the DER encoded private key
key
)

Deprecated
Generates a key specification for an (encrypted) private key.
private static X509Certificate[]
private static PrivateKey
getPrivateKeyFromByteBuffer(Buffer encodedKeyBuf, String keyPassword)

public abstract boolean
isClient()

Returns the true if and only if this context is for client-side.

public final boolean
isServer()

Returns true if and only if this context is for server-side.

pack-priv static char[]
keyStorePassword(String keyPassword)

public static SslContext

Returns:

a new client-side SslContext
newClientContext
()

Deprecated Replaced by SslContextBuilder
Creates a new client-side SslContext.
public static SslContext

Returns:

a new client-side SslContext
newClientContext
(File
an X.509 certificate chain file in PEM format
certChainFile
)

Deprecated Replaced by SslContextBuilder
Creates a new client-side SslContext.
public static SslContext

Returns:

a new client-side SslContext
newClientContext
(TrustManagerFactory
the TrustManagerFactory that provides the TrustManagers that verifies the certificates sent from servers. null to use the default.
trustManagerFactory
)

Deprecated Replaced by SslContextBuilder
Creates a new client-side SslContext.
public static SslContext

Returns:

a new client-side SslContext
newClientContext
(File
an X.509 certificate chain file in PEM format. null to use the system default
certChainFile
,
TrustManagerFactory
the TrustManagerFactory that provides the TrustManagers that verifies the certificates sent from servers. null to use the default.
trustManagerFactory
)

Deprecated Replaced by SslContextBuilder
Creates a new client-side SslContext.
public static SslContext

Returns:

a new client-side SslContext
newClientContext
(File
an X.509 certificate chain file in PEM format. null to use the system default
certChainFile
,
TrustManagerFactory
the TrustManagerFactory that provides the TrustManagers that verifies the certificates sent from servers. null to use the default.
trustManagerFactory
,
Iterable<String>
the cipher suites to enable, in the order of preference. null to use the default cipher suites.
ciphers
,
Iterable<String>
the application layer protocols to accept, in the order of preference. null to disable TLS NPN/ALPN extension.
nextProtocols
,
long
the size of the cache used for storing SSL session objects. 0 to use the default value.
sessionCacheSize
,
long
the timeout for the cached SSL session objects, in seconds. 0 to use the default value.
sessionTimeout
)

Deprecated Replaced by SslContextBuilder
Creates a new client-side SslContext.
public static SslContext

Returns:

a new client-side SslContext
newClientContext
(File
an X.509 certificate chain file in PEM format. null to use the system default
certChainFile
,
TrustManagerFactory
the TrustManagerFactory that provides the TrustManagers that verifies the certificates sent from servers. null to use the default.
trustManagerFactory
,
Iterable<String>
the cipher suites to enable, in the order of preference. null to use the default cipher suites.
ciphers
,
CipherSuiteFilter
a filter to apply over the supplied list of ciphers
cipherFilter
,
ApplicationProtocolConfig
Provides a means to configure parameters related to application protocol negotiation.
apn
,
long
the size of the cache used for storing SSL session objects. 0 to use the default value.
sessionCacheSize
,
long
the timeout for the cached SSL session objects, in seconds. 0 to use the default value.
sessionTimeout
)

Deprecated Replaced by SslContextBuilder
Creates a new client-side SslContext.
public static SslContext

Returns:

a new client-side SslContext
newClientContext
(SslProvider
the SslContext implementation to use. null to use the current default one.
provider
)

Deprecated Replaced by SslContextBuilder
Creates a new client-side SslContext.
public static SslContext

Returns:

a new client-side SslContext
newClientContext
(SslProvider
the SslContext implementation to use. null to use the current default one.
provider
,
File
an X.509 certificate chain file in PEM format. null to use the system default
certChainFile
)

Deprecated Replaced by SslContextBuilder
Creates a new client-side SslContext.
public static SslContext

Returns:

a new client-side SslContext
newClientContext
(SslProvider
the SslContext implementation to use. null to use the current default one.
provider
,
TrustManagerFactory
the TrustManagerFactory that provides the TrustManagers that verifies the certificates sent from servers. null to use the default.
trustManagerFactory
)

Deprecated Replaced by SslContextBuilder
Creates a new client-side SslContext.
public static SslContext

Returns:

a new client-side SslContext
newClientContext
(SslProvider
the SslContext implementation to use. null to use the current default one.
provider
,
File
an X.509 certificate chain file in PEM format. null to use the system default
certChainFile
,
TrustManagerFactory
the TrustManagerFactory that provides the TrustManagers that verifies the certificates sent from servers. null to use the default.
trustManagerFactory
)

Deprecated Replaced by SslContextBuilder
Creates a new client-side SslContext.
public static SslContext

Returns:

a new client-side SslContext
newClientContext
(SslProvider
the SslContext implementation to use. null to use the current default one.
provider
,
File
an X.509 certificate chain file in PEM format. null to use the system default
certChainFile
,
TrustManagerFactory
the TrustManagerFactory that provides the TrustManagers that verifies the certificates sent from servers. null to use the default.
trustManagerFactory
,
Iterable<String>
the cipher suites to enable, in the order of preference. null to use the default cipher suites.
ciphers
,
Iterable<String>
the application layer protocols to accept, in the order of preference. null to disable TLS NPN/ALPN extension.
nextProtocols
,
long
the size of the cache used for storing SSL session objects. 0 to use the default value.
sessionCacheSize
,
long
the timeout for the cached SSL session objects, in seconds. 0 to use the default value.
sessionTimeout
)

Deprecated Replaced by SslContextBuilder
Creates a new client-side SslContext.
public static SslContext

Returns:

a new client-side SslContext
newClientContext
(SslProvider
the SslContext implementation to use. null to use the current default one.
provider
,
File
an X.509 certificate chain file in PEM format. null to use the system default
certChainFile
,
TrustManagerFactory
the TrustManagerFactory that provides the TrustManagers that verifies the certificates sent from servers. null to use the default.
trustManagerFactory
,
Iterable<String>
the cipher suites to enable, in the order of preference. null to use the default cipher suites.
ciphers
,
CipherSuiteFilter
a filter to apply over the supplied list of ciphers
cipherFilter
,
ApplicationProtocolConfig
Provides a means to configure parameters related to application protocol negotiation.
apn
,
long
the size of the cache used for storing SSL session objects. 0 to use the default value.
sessionCacheSize
,
long
the timeout for the cached SSL session objects, in seconds. 0 to use the default value.
sessionTimeout
)

Deprecated Replaced by SslContextBuilder
Creates a new client-side SslContext.
public static SslContext

Returns:

a new client-side SslContext
newClientContext
(SslProvider
the SslContext implementation to use. null to use the current default one.
provider
,
File
an X.509 certificate collection file in PEM format. null to use the system default
trustCertCollectionFile
,
TrustManagerFactory
the TrustManagerFactory that provides the TrustManagers that verifies the certificates sent from servers. null to use the default or the results of parsing trustCertCollectionFile. This parameter is ignored if provider is not SslProvider#JDK.
trustManagerFactory
,
File
an X.509 certificate chain file in PEM format. This provides the public key for mutual authentication. null to use the system default
keyCertChainFile
,
File
a PKCS#8 private key file in PEM format. This provides the private key for mutual authentication. null for no mutual authentication.
keyFile
,
String
the password of the keyFile. null if it's not password-protected. Ignored if keyFile is null.
keyPassword
,
KeyManagerFactory
the KeyManagerFactory that provides the KeyManagers that is used to encrypt data being sent to servers. null to use the default or the results of parsing keyCertChainFile and keyFile. This parameter is ignored if provider is not SslProvider#JDK.
keyManagerFactory
,
Iterable<String>
the cipher suites to enable, in the order of preference. null to use the default cipher suites.
ciphers
,
CipherSuiteFilter
a filter to apply over the supplied list of ciphers
cipherFilter
,
ApplicationProtocolConfig
Provides a means to configure parameters related to application protocol negotiation.
apn
,
long
the size of the cache used for storing SSL session objects. 0 to use the default value.
sessionCacheSize
,
long
the timeout for the cached SSL session objects, in seconds. 0 to use the default value.
sessionTimeout
)

Deprecated Replaced by SslContextBuilder
Creates a new client-side SslContext.
pack-priv static SslContext
newClientContextInternal(SslProvider provider, Provider sslContextProvider, X509Certificate[] trustCert, TrustManagerFactory trustManagerFactory, X509Certificate[] keyCertChain, PrivateKey key, String keyPassword, KeyManagerFactory keyManagerFactory, Iterable<String> ciphers, CipherSuiteFilter cipherFilter, ApplicationProtocolConfig apn, String[] protocols, long sessionCacheSize, long sessionTimeout, boolean enableOcsp, String keyStoreType, Map.Entry<SslContextOption<?>, Object>... options)

public abstract SSLEngine

Returns:

a new SSLEngine
newEngine
(BufferAllocator alloc)

Creates a new SSLEngine.

public abstract SSLEngine

Returns:

a new SSLEngine
newEngine
(BufferAllocator alloc, String
the non-authoritative name of the host
peerHost
,
int
the non-authoritative port
peerPort
)

Creates a new SSLEngine using advisory peer information.

public final SslHandler
newHandler(BufferAllocator alloc)

Create a new SslHandler.

protected SslHandler
newHandler(BufferAllocator alloc, boolean startTls)

Create a new SslHandler.

public SslHandler

Returns:

a new SslHandler
newHandler
(BufferAllocator
If supported by the SSLEngine then the SSLEngine will use this to allocate Buffer objects.
alloc
,
Executor
the Executor that will be used to execute tasks that are returned by SSLEngine#getDelegatedTask().
delegatedTaskExecutor
)

Creates a new SslHandler.

protected SslHandler
newHandler(BufferAllocator alloc, boolean startTls, Executor executor)

Create a new SslHandler.

public final SslHandler
newHandler(BufferAllocator alloc, String peerHost, int peerPort)

Creates a new SslHandler

protected SslHandler
newHandler(BufferAllocator alloc, String peerHost, int peerPort, boolean startTls)

Create a new SslHandler.

public SslHandler

Returns:

a new SslHandler
newHandler
(BufferAllocator
If supported by the SSLEngine then the SSLEngine will use this to allocate Buffer objects.
alloc
,
String
the non-authoritative name of the host
peerHost
,
int
the non-authoritative port
peerPort
,
Executor
the Executor that will be used to execute tasks that are returned by SSLEngine#getDelegatedTask().
delegatedTaskExecutor
)

Creates a new SslHandler with advisory peer information.

protected SslHandler
newHandler(BufferAllocator alloc, String peerHost, int peerPort, boolean startTls, Executor delegatedTaskExecutor)

public static SslContext

Returns:

a new server-side SslContext
newServerContext
(File
an X.509 certificate chain file in PEM format
certChainFile
,
File
a PKCS#8 private key file in PEM format
keyFile
)

Deprecated Replaced by SslContextBuilder
Creates a new server-side SslContext.
public static SslContext

Returns:

a new server-side SslContext
newServerContext
(File
an X.509 certificate chain file in PEM format
certChainFile
,
File
a PKCS#8 private key file in PEM format
keyFile
,
String
the password of the keyFile. null if it's not password-protected.
keyPassword
)

Deprecated Replaced by SslContextBuilder
Creates a new server-side SslContext.
public static SslContext

Returns:

a new server-side SslContext
newServerContext
(File
an X.509 certificate chain file in PEM format
certChainFile
,
File
a PKCS#8 private key file in PEM format
keyFile
,
String
the password of the keyFile. null if it's not password-protected.
keyPassword
,
Iterable<String>
the cipher suites to enable, in the order of preference. null to use the default cipher suites.
ciphers
,
Iterable<String>
the application layer protocols to accept, in the order of preference. null to disable TLS NPN/ALPN extension.
nextProtocols
,
long
the size of the cache used for storing SSL session objects. 0 to use the default value.
sessionCacheSize
,
long
the timeout for the cached SSL session objects, in seconds. 0 to use the default value.
sessionTimeout
)

Deprecated Replaced by SslContextBuilder
Creates a new server-side SslContext.
public static SslContext

Returns:

a new server-side SslContext
newServerContext
(File
an X.509 certificate chain file in PEM format
certChainFile
,
File
a PKCS#8 private key file in PEM format
keyFile
,
String
the password of the keyFile. null if it's not password-protected.
keyPassword
,
Iterable<String>
the cipher suites to enable, in the order of preference. null to use the default cipher suites.
ciphers
,
CipherSuiteFilter
a filter to apply over the supplied list of ciphers
cipherFilter
,
ApplicationProtocolConfig
Provides a means to configure parameters related to application protocol negotiation.
apn
,
long
the size of the cache used for storing SSL session objects. 0 to use the default value.
sessionCacheSize
,
long
the timeout for the cached SSL session objects, in seconds. 0 to use the default value.
sessionTimeout
)

Deprecated Replaced by SslContextBuilder
Creates a new server-side SslContext.
public static SslContext

Returns:

a new server-side SslContext
newServerContext
(SslProvider
the SslContext implementation to use. null to use the current default one.
provider
,
File
an X.509 certificate chain file in PEM format
certChainFile
,
File
a PKCS#8 private key file in PEM format
keyFile
)

Deprecated Replaced by SslContextBuilder
Creates a new server-side SslContext.
public static SslContext

Returns:

a new server-side SslContext
newServerContext
(SslProvider
the SslContext implementation to use. null to use the current default one.
provider
,
File
an X.509 certificate chain file in PEM format
certChainFile
,
File
a PKCS#8 private key file in PEM format
keyFile
,
String
the password of the keyFile. null if it's not password-protected.
keyPassword
)

Deprecated Replaced by SslContextBuilder
Creates a new server-side SslContext.
public static SslContext

Returns:

a new server-side SslContext
newServerContext
(SslProvider
the SslContext implementation to use. null to use the current default one.
provider
,
File
an X.509 certificate chain file in PEM format
certChainFile
,
File
a PKCS#8 private key file in PEM format
keyFile
,
String
the password of the keyFile. null if it's not password-protected.
keyPassword
,
Iterable<String>
the cipher suites to enable, in the order of preference. null to use the default cipher suites.
ciphers
,
Iterable<String>
the application layer protocols to accept, in the order of preference. null to disable TLS NPN/ALPN extension.
nextProtocols
,
long
the size of the cache used for storing SSL session objects. 0 to use the default value.
sessionCacheSize
,
long
the timeout for the cached SSL session objects, in seconds. 0 to use the default value.
sessionTimeout
)

Deprecated Replaced by SslContextBuilder
Creates a new server-side SslContext.
public static SslContext

Returns:

a new server-side SslContext
newServerContext
(SslProvider
the SslContext implementation to use. null to use the current default one.
provider
,
File
an X.509 certificate chain file in PEM format
certChainFile
,
File
a PKCS#8 private key file in PEM format
keyFile
,
String
the password of the keyFile. null if it's not password-protected.
keyPassword
,
TrustManagerFactory
the TrustManagerFactory that provides the TrustManagers that verifies the certificates sent from servers. null to use the default.
trustManagerFactory
,
Iterable<String>
the cipher suites to enable, in the order of preference. null to use the default cipher suites.
ciphers
,
Iterable<String>
the application layer protocols to accept, in the order of preference. null to disable TLS NPN/ALPN extension.
nextProtocols
,
long
the size of the cache used for storing SSL session objects. 0 to use the default value.
sessionCacheSize
,
long
the timeout for the cached SSL session objects, in seconds. 0 to use the default value.
sessionTimeout
)

Deprecated Replaced by SslContextBuilder
Creates a new server-side SslContext.
public static SslContext

Returns:

a new server-side SslContext
newServerContext
(SslProvider
the SslContext implementation to use. null to use the current default one.
provider
,
File
an X.509 certificate chain file in PEM format
certChainFile
,
File
a PKCS#8 private key file in PEM format
keyFile
,
String
the password of the keyFile. null if it's not password-protected.
keyPassword
,
Iterable<String>
the cipher suites to enable, in the order of preference. null to use the default cipher suites.
ciphers
,
CipherSuiteFilter
a filter to apply over the supplied list of ciphers Only required if provider is SslProvider#JDK
cipherFilter
,
ApplicationProtocolConfig
Provides a means to configure parameters related to application protocol negotiation.
apn
,
long
the size of the cache used for storing SSL session objects. 0 to use the default value.
sessionCacheSize
,
long
the timeout for the cached SSL session objects, in seconds. 0 to use the default value.
sessionTimeout
)

Deprecated Replaced by SslContextBuilder
Creates a new server-side SslContext.
public static SslContext

Returns:

a new server-side SslContext
newServerContext
(SslProvider
the SslContext implementation to use. null to use the current default one.
provider
,
File
an X.509 certificate collection file in PEM format. This provides the certificate collection used for mutual authentication. null to use the system default
trustCertCollectionFile
,
TrustManagerFactory
the TrustManagerFactory that provides the TrustManagers that verifies the certificates sent from clients. null to use the default or the results of parsing trustCertCollectionFile. This parameter is ignored if provider is not SslProvider#JDK.
trustManagerFactory
,
File
an X.509 certificate chain file in PEM format
keyCertChainFile
,
File
a PKCS#8 private key file in PEM format
keyFile
,
String
the password of the keyFile. null if it's not password-protected.
keyPassword
,
KeyManagerFactory
the KeyManagerFactory that provides the KeyManagers that is used to encrypt data being sent to clients. null to use the default or the results of parsing keyCertChainFile and keyFile. This parameter is ignored if provider is not SslProvider#JDK.
keyManagerFactory
,
Iterable<String>
the cipher suites to enable, in the order of preference. null to use the default cipher suites.
ciphers
,
CipherSuiteFilter
a filter to apply over the supplied list of ciphers Only required if provider is SslProvider#JDK
cipherFilter
,
ApplicationProtocolConfig
Provides a means to configure parameters related to application protocol negotiation.
apn
,
long
the size of the cache used for storing SSL session objects. 0 to use the default value.
sessionCacheSize
,
long
the timeout for the cached SSL session objects, in seconds. 0 to use the default value.
sessionTimeout
)

Deprecated Replaced by SslContextBuilder
Creates a new server-side SslContext.
pack-priv static SslContext

Returns:

a new server-side SslContext
newServerContext
(SslProvider
the SslContext implementation to use. null to use the current default one.
provider
,
File
an X.509 certificate collection file in PEM format. This provides the certificate collection used for mutual authentication. null to use the system default
trustCertCollectionFile
,
TrustManagerFactory
the TrustManagerFactory that provides the TrustManagers that verifies the certificates sent from clients. null to use the default or the results of parsing trustCertCollectionFile. This parameter is ignored if provider is not SslProvider#JDK.
trustManagerFactory
,
File
an X.509 certificate chain file in PEM format
keyCertChainFile
,
File
a PKCS#8 private key file in PEM format
keyFile
,
String
the password of the keyFile. null if it's not password-protected.
keyPassword
,
KeyManagerFactory
the KeyManagerFactory that provides the KeyManagers that is used to encrypt data being sent to clients. null to use the default or the results of parsing keyCertChainFile and keyFile. This parameter is ignored if provider is not SslProvider#JDK.
keyManagerFactory
,
Iterable<String>
the cipher suites to enable, in the order of preference. null to use the default cipher suites.
ciphers
,
CipherSuiteFilter
a filter to apply over the supplied list of ciphers Only required if provider is SslProvider#JDK
cipherFilter
,
ApplicationProtocolConfig
Provides a means to configure parameters related to application protocol negotiation.
apn
,
long
the size of the cache used for storing SSL session objects. 0 to use the default value.
sessionCacheSize
,
long
the timeout for the cached SSL session objects, in seconds. 0 to use the default value.
sessionTimeout
,
String
the keystore type that should be used
keyStore
)

Creates a new server-side SslContext.

pack-priv static SslContext
newServerContextInternal(SslProvider provider, Provider sslContextProvider, X509Certificate[] trustCertCollection, TrustManagerFactory trustManagerFactory, X509Certificate[] keyCertChain, PrivateKey key, String keyPassword, KeyManagerFactory keyManagerFactory, Iterable<String> ciphers, CipherSuiteFilter cipherFilter, ApplicationProtocolConfig apn, long sessionCacheSize, long sessionTimeout, ClientAuth clientAuth, String[] protocols, boolean startTls, boolean enableOcsp, String keyStoreType, Map.Entry<SslContextOption<?>, Object>... ctxOptions)

public final List<String>
public long
sessionCacheSize()

Returns the size of the cache used for storing SSL session objects.

public abstract SSLSessionContext
sessionContext()

Returns the SSLSessionContext object held by this context.

public long
sessionTimeout()

Returns the timeout for the cached SSL session objects, in seconds.

pack-priv static ApplicationProtocolConfig
protected static PrivateKey
toPrivateKey(File keyFile, String keyPassword)

protected static PrivateKey
toPrivateKey(InputStream keyInputStream, String keyPassword)

pack-priv static PrivateKey
toPrivateKeyInternal(File keyFile, String keyPassword)

protected static X509Certificate[]
protected static X509Certificate[]
pack-priv static X509Certificate[]
private static void
verifyNullSslContextProvider(SslProvider provider, Provider sslContextProvider)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait