public final class SslContextBuilder extends Object
Modifier and Type | Method and Description |
---|---|
SslContextBuilder |
applicationProtocolConfig(ApplicationProtocolConfig apn)
Application protocol negotiation configuration.
|
SslContext |
build()
Create new
SslContext instance with configured settings. |
SslContextBuilder |
ciphers(Iterable<String> ciphers)
The cipher suites to enable, in the order of preference.
|
SslContextBuilder |
ciphers(Iterable<String> ciphers,
CipherSuiteFilter cipherFilter)
The cipher suites to enable, in the order of preference.
|
static SslContextBuilder |
forClient()
Creates a builder for new client-side
SslContext . |
static SslContextBuilder |
forServer(File keyCertChainFile,
File keyFile)
Creates a builder for new server-side
SslContext . |
static SslContextBuilder |
forServer(File keyCertChainFile,
File keyFile,
String keyPassword)
Creates a builder for new server-side
SslContext . |
SslContextBuilder |
keyManager(File keyCertChainFile,
File keyFile)
Identifying certificate for this host.
|
SslContextBuilder |
keyManager(File keyCertChainFile,
File keyFile,
String keyPassword)
Identifying certificate for this host.
|
SslContextBuilder |
keyManager(KeyManagerFactory keyManagerFactory)
Identifying manager for this host.
|
SslContextBuilder |
sessionCacheSize(long sessionCacheSize)
Set the size of the cache used for storing SSL session objects.
|
SslContextBuilder |
sessionTimeout(long sessionTimeout)
Set the timeout for the cached SSL session objects, in seconds.
|
SslContextBuilder |
sslProvider(SslProvider provider)
The
SslContext implementation to use. |
SslContextBuilder |
trustManager(File trustCertChainFile)
Trusted certificates for verifying the remote endpoint's certificate.
|
SslContextBuilder |
trustManager(TrustManagerFactory trustManagerFactory)
Trusted manager for verifying the remote endpoint's certificate.
|
public static SslContextBuilder forClient()
SslContext
.public static SslContextBuilder forServer(File keyCertChainFile, File keyFile)
SslContext
.keyCertChainFile
- an X.509 certificate chain file in PEM formatkeyFile
- a PKCS#8 private key file in PEM formatpublic static SslContextBuilder forServer(File keyCertChainFile, File keyFile, String keyPassword)
SslContext
.keyCertChainFile
- an X.509 certificate chain file in PEM formatkeyFile
- a PKCS#8 private key file in PEM formatkeyPassword
- the password of the keyFile
, or null
if it's not
password-protectedpublic SslContextBuilder sslProvider(SslProvider provider)
SslContext
implementation to use. null
uses the default one.public SslContextBuilder trustManager(File trustCertChainFile)
null
uses the system default.public SslContextBuilder trustManager(TrustManagerFactory trustManagerFactory)
TrustManagerFactory
is only supported for SslProvider.JDK
; for other providers,
you must use trustManager(File)
. null
uses the system default.public SslContextBuilder keyManager(File keyCertChainFile, File keyFile)
keyCertChainFile
and keyFile
may
be null
for client contexts, which disables mutual authentication.keyCertChainFile
- an X.509 certificate chain file in PEM formatkeyFile
- a PKCS#8 private key file in PEM formatpublic SslContextBuilder keyManager(File keyCertChainFile, File keyFile, String keyPassword)
keyCertChainFile
and keyFile
may
be null
for client contexts, which disables mutual authentication.keyCertChainFile
- an X.509 certificate chain file in PEM formatkeyFile
- a PKCS#8 private key file in PEM formatkeyPassword
- the password of the keyFile
, or null
if it's not
password-protectedpublic SslContextBuilder keyManager(KeyManagerFactory keyManagerFactory)
keyManagerFactory
may be null
for
client contexts, which disables mutual authentication. Using a KeyManagerFactory
is only supported for SslProvider.JDK
; for other providers, you must use keyManager(File, File)
or keyManager(File, File, String)
.public SslContextBuilder ciphers(Iterable<String> ciphers)
null
to use default
cipher suites.public SslContextBuilder ciphers(Iterable<String> ciphers, CipherSuiteFilter cipherFilter)
cipherFilter
will be
applied to the ciphers before use if provider is SslProvider.JDK
. If ciphers
is null
, then the default cipher suites will be used.public SslContextBuilder applicationProtocolConfig(ApplicationProtocolConfig apn)
null
disables support.public SslContextBuilder sessionCacheSize(long sessionCacheSize)
0
to use the
default value.public SslContextBuilder sessionTimeout(long sessionTimeout)
0
to use the
default value.public SslContext build() throws SSLException
SslContext
instance with configured settings.SSLException
Copyright © 2008–2015 The Netty Project. All rights reserved.