public final class OpenSslServerContext extends SslContext
SslContext which uses OpenSSL's SSL/TLS implementation.| Modifier and Type | Field and Description |
|---|---|
private long |
aprPool |
private java.util.List<java.lang.String> |
ciphers |
private long |
ctx
The OpenSSL SSL_CTX object
|
private static java.util.List<java.lang.String> |
DEFAULT_CIPHERS |
private static InternalLogger |
logger |
private java.util.List<java.lang.String> |
nextProtocols |
private long |
sessionCacheSize |
private long |
sessionTimeout |
private OpenSslSessionStats |
stats |
private java.util.List<java.lang.String> |
unmodifiableCiphers |
| Constructor and Description |
|---|
OpenSslServerContext(java.io.File certChainFile,
java.io.File keyFile)
Creates a new instance.
|
OpenSslServerContext(java.io.File certChainFile,
java.io.File keyFile,
java.lang.String keyPassword)
Creates a new instance.
|
OpenSslServerContext(SslBufferPool bufPool,
java.io.File certChainFile,
java.io.File keyFile,
java.lang.String keyPassword,
java.lang.Iterable<java.lang.String> ciphers,
java.lang.Iterable<java.lang.String> nextProtocols,
long sessionCacheSize,
long sessionTimeout)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.lang.String> |
cipherSuites()
Returns the list of enabled cipher suites, in the order of preference.
|
long |
context()
Returns the
SSL_CTX object of this context. |
private void |
destroyPools() |
protected void |
finalize() |
boolean |
isClient()
Returns the
true if and only if this context is for client-side. |
(package private) SslBufferPool |
newBufferPool() |
javax.net.ssl.SSLEngine |
newEngine()
Returns a new server-side
SSLEngine with the current configuration. |
javax.net.ssl.SSLEngine |
newEngine(java.lang.String peerHost,
int peerPort)
Creates a new
SSLEngine using advisory peer information. |
java.util.List<java.lang.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, newServerContextprivate static final InternalLogger logger
private static final java.util.List<java.lang.String> DEFAULT_CIPHERS
private final long aprPool
private final java.util.List<java.lang.String> ciphers
private final java.util.List<java.lang.String> unmodifiableCiphers
private final long sessionCacheSize
private final long sessionTimeout
private final java.util.List<java.lang.String> nextProtocols
private final long ctx
private final OpenSslSessionStats stats
public OpenSslServerContext(java.io.File certChainFile,
java.io.File keyFile)
throws javax.net.ssl.SSLException
certChainFile - an X.509 certificate chain file in PEM formatkeyFile - a PKCS#8 private key file in PEM formatjavax.net.ssl.SSLExceptionpublic OpenSslServerContext(java.io.File certChainFile,
java.io.File keyFile,
java.lang.String keyPassword)
throws javax.net.ssl.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.javax.net.ssl.SSLExceptionpublic OpenSslServerContext(SslBufferPool bufPool, java.io.File certChainFile, java.io.File keyFile, java.lang.String keyPassword, java.lang.Iterable<java.lang.String> ciphers, java.lang.Iterable<java.lang.String> nextProtocols, long sessionCacheSize, long sessionTimeout) throws javax.net.ssl.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.javax.net.ssl.SSLExceptionSslBufferPool newBufferPool()
newBufferPool in class SslContextpublic boolean isClient()
SslContexttrue if and only if this context is for client-side.isClient in class SslContextpublic java.util.List<java.lang.String> cipherSuites()
SslContextcipherSuites in class SslContextpublic long sessionCacheSize()
SslContextsessionCacheSize in class SslContextpublic long sessionTimeout()
SslContextsessionTimeout in class SslContextpublic java.util.List<java.lang.String> nextProtocols()
SslContextnextProtocols in class SslContextnull if NPN/ALPN extension has been disabled.public long context()
SSL_CTX object of this context.public OpenSslSessionStats stats()
public javax.net.ssl.SSLEngine newEngine()
SSLEngine with the current configuration.newEngine in class SslContextSSLEnginepublic javax.net.ssl.SSLEngine newEngine(java.lang.String peerHost,
int peerPort)
SslContextSSLEngine using advisory peer information.newEngine in class SslContextpeerHost - the non-authoritative name of the hostpeerPort - the non-authoritative portSSLEnginepublic void setTicketKeys(byte[] keys)
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwableprivate void destroyPools()