public final class OpenSslServerContext extends SslContext
SslContext
which uses OpenSSL's SSL/TLS implementation.Constructor and Description |
---|
OpenSslServerContext(File certChainFile,
File keyFile)
Creates a new instance.
|
OpenSslServerContext(File certChainFile,
File keyFile,
String keyPassword)
Creates a new instance.
|
OpenSslServerContext(SslBufferPool bufPool,
File certChainFile,
File keyFile,
String keyPassword,
Iterable<String> ciphers,
Iterable<String> nextProtocols,
long sessionCacheSize,
long sessionTimeout)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
List<String> |
cipherSuites()
Returns the list of enabled cipher suites, in the order of preference.
|
long |
context()
Returns the
SSL_CTX object of this context. |
protected void |
finalize() |
boolean |
isClient()
Returns the
true if and only if this context is for client-side. |
SSLEngine |
newEngine()
Returns a new server-side
SSLEngine with the current configuration. |
SSLEngine |
newEngine(String peerHost,
int peerPort)
Creates a new
SSLEngine using advisory peer information. |
List<String> |
nextProtocols()
Returns the list of application layer protocols for the TLS NPN/ALPN extension, in the order of preference.
|
long |
sessionCacheSize()
Returns the size of the cache used for storing SSL session objects.
|
long |
sessionTimeout()
Returns the timeout for the cached SSL session objects, in seconds.
|
void |
setTicketKeys(byte[] keys)
Sets the SSL session ticket keys of this context.
|
OpenSslSessionStats |
stats()
Returns the stats of this context.
|
bufferPool, defaultClientProvider, defaultServerProvider, isServer, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newHandler, newHandler, newServerContext, newServerContext, newServerContext, newServerContext, newServerContext, newServerContext
public OpenSslServerContext(File certChainFile, File keyFile) throws SSLException
certChainFile
- an X.509 certificate chain file in PEM formatkeyFile
- a PKCS#8 private key file in PEM formatSSLException
public OpenSslServerContext(File certChainFile, File keyFile, String keyPassword) throws SSLException
certChainFile
- an X.509 certificate chain file in PEM formatkeyFile
- a PKCS#8 private key file in PEM formatkeyPassword
- the password of the keyFile
.
null
if it's not password-protected.SSLException
public OpenSslServerContext(SslBufferPool bufPool, File certChainFile, File keyFile, String keyPassword, Iterable<String> ciphers, Iterable<String> nextProtocols, long sessionCacheSize, long sessionTimeout) throws SSLException
bufPool
- the buffer pool which will be used by this context.
null
to use the default buffer pool.certChainFile
- an X.509 certificate chain file in PEM formatkeyFile
- a PKCS#8 private key file in PEM formatkeyPassword
- the password of the keyFile
.
null
if it's not password-protected.ciphers
- the cipher suites to enable, in the order of preference.
null
to use the default cipher suites.nextProtocols
- the application layer protocols to accept, in the order of preference.
null
to disable TLS NPN/ALPN extension.sessionCacheSize
- the size of the cache used for storing SSL session objects.
0
to use the default value.sessionTimeout
- the timeout for the cached SSL session objects, in seconds.
0
to use the default value.SSLException
public boolean isClient()
SslContext
true
if and only if this context is for client-side.isClient
in class SslContext
public List<String> cipherSuites()
SslContext
cipherSuites
in class SslContext
public long sessionCacheSize()
SslContext
sessionCacheSize
in class SslContext
public long sessionTimeout()
SslContext
sessionTimeout
in class SslContext
public List<String> nextProtocols()
SslContext
nextProtocols
in class SslContext
null
if NPN/ALPN extension has been disabled.public long context()
SSL_CTX
object of this context.public OpenSslSessionStats stats()
public SSLEngine newEngine()
SSLEngine
with the current configuration.newEngine
in class SslContext
SSLEngine
public SSLEngine newEngine(String peerHost, int peerPort)
SslContext
SSLEngine
using advisory peer information.newEngine
in class SslContext
peerHost
- the non-authoritative name of the hostpeerPort
- the non-authoritative portSSLEngine
public void setTicketKeys(byte[] keys)
Copyright © 2008-2015 The Netty Project. All Rights Reserved.