Package org.jboss.netty.handler.ssl
Class OpenSslServerContext
java.lang.Object
org.jboss.netty.handler.ssl.SslContext
org.jboss.netty.handler.ssl.OpenSslServerContext
A server-side
SslContext
which uses OpenSSL's SSL/TLS implementation.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long
private final long
The OpenSSL SSL_CTX objectprivate static final InternalLogger
private final long
private final long
private final OpenSslSessionStats
-
Constructor Summary
ConstructorsConstructorDescriptionOpenSslServerContext
(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. -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of enabled cipher suites, in the order of preference.long
context()
Returns theSSL_CTX
object of this context.private void
protected void
finalize()
boolean
isClient()
Returns thetrue
if and only if this context is for client-side.(package private) SslBufferPool
Returns a new server-sideSSLEngine
with the current configuration.Creates a newSSLEngine
using advisory peer information.Returns the list of application layer protocols for the TLS NPN/ALPN extension, in the order of preference.long
Returns the size of the cache used for storing SSL session objects.long
Returns the timeout for the cached SSL session objects, in seconds.void
setTicketKeys
(byte[] keys) Sets the SSL session ticket keys of this context.stats()
Returns the stats of this context.Methods inherited from class org.jboss.netty.handler.ssl.SslContext
bufferPool, defaultClientProvider, defaultServerProvider, isServer, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newHandler, newHandler, newServerContext, newServerContext, newServerContext, newServerContext, newServerContext, newServerContext
-
Field Details
-
logger
-
DEFAULT_CIPHERS
-
aprPool
private final long aprPool -
ciphers
-
unmodifiableCiphers
-
sessionCacheSize
private final long sessionCacheSize -
sessionTimeout
private final long sessionTimeout -
nextProtocols
-
ctx
private final long ctxThe OpenSSL SSL_CTX object -
stats
-
-
Constructor Details
-
OpenSslServerContext
Creates a new instance.- Parameters:
certChainFile
- an X.509 certificate chain file in PEM formatkeyFile
- a PKCS#8 private key file in PEM format- Throws:
SSLException
-
OpenSslServerContext
public OpenSslServerContext(File certChainFile, File keyFile, String keyPassword) throws SSLException Creates a new instance.- Parameters:
certChainFile
- an X.509 certificate chain file in PEM formatkeyFile
- a PKCS#8 private key file in PEM formatkeyPassword
- the password of thekeyFile
.null
if it's not password-protected.- Throws:
SSLException
-
OpenSslServerContext
public OpenSslServerContext(SslBufferPool bufPool, File certChainFile, File keyFile, String keyPassword, Iterable<String> ciphers, Iterable<String> nextProtocols, long sessionCacheSize, long sessionTimeout) throws SSLException Creates a new instance.- Parameters:
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 thekeyFile
.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.- Throws:
SSLException
-
-
Method Details
-
newBufferPool
SslBufferPool newBufferPool()- Overrides:
newBufferPool
in classSslContext
-
isClient
public boolean isClient()Description copied from class:SslContext
Returns thetrue
if and only if this context is for client-side.- Specified by:
isClient
in classSslContext
-
cipherSuites
Description copied from class:SslContext
Returns the list of enabled cipher suites, in the order of preference.- Specified by:
cipherSuites
in classSslContext
-
sessionCacheSize
public long sessionCacheSize()Description copied from class:SslContext
Returns the size of the cache used for storing SSL session objects.- Specified by:
sessionCacheSize
in classSslContext
-
sessionTimeout
public long sessionTimeout()Description copied from class:SslContext
Returns the timeout for the cached SSL session objects, in seconds.- Specified by:
sessionTimeout
in classSslContext
-
nextProtocols
Description copied from class:SslContext
Returns the list of application layer protocols for the TLS NPN/ALPN extension, in the order of preference.- Specified by:
nextProtocols
in classSslContext
- Returns:
- the list of application layer protocols.
null
if NPN/ALPN extension has been disabled.
-
context
public long context()Returns theSSL_CTX
object of this context. -
stats
Returns the stats of this context. -
newEngine
Returns a new server-sideSSLEngine
with the current configuration.- Specified by:
newEngine
in classSslContext
- Returns:
- a new
SSLEngine
-
newEngine
Description copied from class:SslContext
Creates a newSSLEngine
using advisory peer information.- Specified by:
newEngine
in classSslContext
- Parameters:
peerHost
- the non-authoritative name of the hostpeerPort
- the non-authoritative port- Returns:
- a new
SSLEngine
-
setTicketKeys
public void setTicketKeys(byte[] keys) Sets the SSL session ticket keys of this context. -
finalize
-
destroyPools
private void destroyPools()
-