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

public abstract Class OpenSslSessionContext

extends Object
implements SSLSessionContext
Class Inheritance
All Implemented Interfaces
javax.net.ssl.SSLSessionContext
Known Direct Subclasses
io.netty.handler.ssl.ReferenceCountedOpenSslClientContext.OpenSslClientSessionContext, io.netty.handler.ssl.OpenSslServerSessionContext
Imports
io.netty.internal.tcnative.SSL, .SSLContext, .SessionTicketKey, io.netty.util.internal.ObjectUtil, javax.net.ssl.SSLSession, .SSLSessionContext, java.util.Arrays, .Enumeration, .Iterator, java.util.concurrent.locks.Lock

OpenSSL specific SSLSessionContext implementation.

Field Summary

Modifier and TypeField and Description
pack-priv final ReferenceCountedOpenSslContext
private final long
private final OpenSslKeyMaterialProvider
private final OpenSslSessionCache
private final OpenSslSessionStats

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv final void
public Enumeration<byte[]>
getIds()

Implements javax.net.ssl.SSLSessionContext.getIds.

Returns an Enumeration of all known session id's grouped under this SSLSessionContext.
public SSLSession
getSession(byte[]
the Session identifier
bytes
)

Implements javax.net.ssl.SSLSessionContext.getSession.

Returns the SSLSession bound to the specified session id.
public int
getSessionCacheSize()

Implements javax.net.ssl.SSLSessionContext.getSessionCacheSize.

Returns the size of the cache used for storing SSLSession objects grouped under this SSLSessionContext.
public int
getSessionTimeout()

Implements javax.net.ssl.SSLSessionContext.getSessionTimeout.

Returns the timeout limit of SSLSession objects grouped under this SSLSessionContext.
pack-priv final boolean
public boolean
isSessionCacheEnabled()

Return true if caching of SSL sessions is enabled, false otherwise.

pack-priv final void
removeFromCache(OpenSslSessionId id)

Remove the given OpenSslSession from the cache, and so not re-use it for new connections.

public void
setSessionCacheEnabled(boolean enabled)

Enable or disable caching of SSL sessions.

public void
setSessionCacheSize(int
the new session cache size limit; zero means there is no limit.
size
)

Implements javax.net.ssl.SSLSessionContext.setSessionCacheSize.

Sets the size of the cache used for storing SSLSession objects grouped under this SSLSessionContext.
pack-priv boolean
setSessionFromCache(long ssl, OpenSslSession session, String host, int port)

public void
setSessionTimeout(int
the new session timeout limit in seconds; zero means there is no limit.
seconds
)

Implements javax.net.ssl.SSLSessionContext.setSessionTimeout.

Sets the timeout limit for SSLSession objects grouped under this SSLSessionContext.
public void
setTicketKeys(byte[] keys)

Sets the SSL session ticket keys of this context.
public void
setTicketKeys(OpenSslSessionTicketKey... keys)

Sets the SSL session ticket keys of this context.

public OpenSslSessionStats
stats()

Returns the stats of this context.

pack-priv final boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
pack-priv final ReferenceCountedOpenSslContext context
maskback to summary
private final long mask
providerback to summary
private final OpenSslKeyMaterialProvider provider
sessionCacheback to summary
private final OpenSslSessionCache sessionCache
statsback to summary
private final OpenSslSessionStats stats

Constructor Detail

OpenSslSessionContextback to summary
pack-priv OpenSslSessionContext(ReferenceCountedOpenSslContext context, OpenSslKeyMaterialProvider provider, long mask, OpenSslSessionCache cache)

Method Detail

destroyback to summary
pack-priv final void destroy()
getIdsback to summary
public Enumeration<byte[]> getIds()

Implements javax.net.ssl.SSLSessionContext.getIds.

Doc from javax.net.ssl.SSLSessionContext.getIds.

Returns an Enumeration of all known session id's grouped under this SSLSessionContext.

Session contexts may not contain all sessions. For example, stateless sessions are not stored in the session context.

Returns:Enumeration<byte[]>

an enumeration of all the Session id's

Annotations
@Override
getSessionback to summary
public SSLSession getSession(byte[] bytes)

Implements javax.net.ssl.SSLSessionContext.getSession.

Doc from javax.net.ssl.SSLSessionContext.getSession.

Returns the SSLSession bound to the specified session id.

Parameters
bytes:byte[]

the Session identifier

Returns:SSLSession

the SSLSession or null if the specified session id does not refer to a valid SSLSession.

Annotations
@Override
getSessionCacheSizeback to summary
public int getSessionCacheSize()

Implements javax.net.ssl.SSLSessionContext.getSessionCacheSize.

Doc from javax.net.ssl.SSLSessionContext.getSessionCacheSize.

Returns the size of the cache used for storing SSLSession objects grouped under this SSLSessionContext.

Returns:int

size of the session cache; zero means there is no size limit.

Annotations
@Override
getSessionTimeoutback to summary
public int getSessionTimeout()

Implements javax.net.ssl.SSLSessionContext.getSessionTimeout.

Doc from javax.net.ssl.SSLSessionContext.getSessionTimeout.

Returns the timeout limit of SSLSession objects grouped under this SSLSessionContext.

If the timeout limit is set to 't' seconds, a session exceeds the timeout limit 't' seconds after its creation time. When the timeout limit is exceeded for a session, the SSLSession object is invalidated and future connections cannot resume or rejoin the session. A check for sessions exceeding the timeout limit is made immediately whenever the timeout limit is changed for this SSLSessionContext.

Returns:int

the session timeout limit in seconds; zero means there is no limit.

Annotations
@Override
isInCacheback to summary
pack-priv final boolean isInCache(OpenSslSessionId id)
isSessionCacheEnabledback to summary
public boolean isSessionCacheEnabled()

Return true if caching of SSL sessions is enabled, false otherwise.

removeFromCacheback to summary
pack-priv final void removeFromCache(OpenSslSessionId id)

Remove the given OpenSslSession from the cache, and so not re-use it for new connections.

setSessionCacheEnabledback to summary
public void setSessionCacheEnabled(boolean enabled)

Enable or disable caching of SSL sessions.

setSessionCacheSizeback to summary
public void setSessionCacheSize(int size)

Implements javax.net.ssl.SSLSessionContext.setSessionCacheSize.

Doc from javax.net.ssl.SSLSessionContext.setSessionCacheSize.

Sets the size of the cache used for storing SSLSession objects grouped under this SSLSessionContext.

Parameters
size:int

the new session cache size limit; zero means there is no limit.

Annotations
@Override
setSessionFromCacheback to summary
pack-priv boolean setSessionFromCache(long ssl, OpenSslSession session, String host, int port)
setSessionTimeoutback to summary
public void setSessionTimeout(int seconds)

Implements javax.net.ssl.SSLSessionContext.setSessionTimeout.

Doc from javax.net.ssl.SSLSessionContext.setSessionTimeout.

Sets the timeout limit for SSLSession objects grouped under this SSLSessionContext.

If the timeout limit is set to 't' seconds, a session exceeds the timeout limit 't' seconds after its creation time. When the timeout limit is exceeded for a session, the SSLSession object is invalidated and future connections cannot resume or rejoin the session. A check for sessions exceeding the timeout is made immediately whenever the timeout limit is changed for this SSLSessionContext.

Parameters
seconds:int

the new session timeout limit in seconds; zero means there is no limit.

Annotations
@Override
setTicketKeysback to summary
public void setTicketKeys(byte[] keys)

Sets the SSL session ticket keys of this context.

Annotations
@Deprecated
setTicketKeysback to summary
public void setTicketKeys(OpenSslSessionTicketKey... keys)

Sets the SSL session ticket keys of this context. Depending on the underlying native library you may omit the argument or pass an empty array and so let the native library handle the key generation and rotating for you. If this is supported by the underlying native library should be checked in this case. For example BoringSSL is known to support this.

statsback to summary
public OpenSslSessionStats stats()

Returns the stats of this context.

useKeyManagerback to summary
pack-priv final boolean useKeyManager()