Top Description Inners Fields Constructors Methods
org.apache.tomcat.util.net.openssl

public Class OpenSSLSessionContext

extends Object
implements SSLSessionContext
Class Inheritance
All Implemented Interfaces
javax.net.ssl.SSLSessionContext
Imports
java.util.Enumeration, .NoSuchElementException, javax.net.ssl.SSLSession, .SSLSessionContext, org.apache.tomcat.jni.SSL, .SSLContext, org.apache.tomcat.util.res.StringManager

OpenSSL specific SSLSessionContext implementation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final OpenSSLContext
private final long
private static final Enumeration<byte[]>
private static final StringManager
private final OpenSSLSessionStats

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
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.

public boolean

Returns:

true if caching of SSL sessions is enabled, false otherwise.
isSessionCacheEnabled
()

public void
setSessionCacheEnabled(boolean
true to enable caching, false to disable
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.

public boolean

Returns:

true if success, false otherwise.
setSessionIdContext
(byte[]
can be any kind of binary data, it is therefore possible to use e.g. the name of the application and/or the hostname and/or service name
sidCtx
)

Set the context within which session be reused (server side only) See man SSL_CTX_set_session_id_context

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[]
The session ticket keys
keys
)

Sets the SSL session ticket keys of this context.

public OpenSSLSessionStats

Returns:

The statistics for this context.
stats
()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
private final OpenSSLContext context
Annotations
@SuppressWarnings:unused
contextIDback to summary
private final long contextID
EMPTYback to summary
private static final Enumeration<byte[]> EMPTY
smback to summary
private static final StringManager sm
statsback to summary
private final OpenSSLSessionStats stats

Constructor Detail

OpenSSLSessionContextback to summary
pack-priv OpenSSLSessionContext(OpenSSLContext context)

Method Detail

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
isSessionCacheEnabledback to summary
public boolean isSessionCacheEnabled()
Returns:boolean

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

setSessionCacheEnabledback to summary
public void setSessionCacheEnabled(boolean enabled)

Enable or disable caching of SSL sessions.

Parameters
enabled:boolean

true to enable caching, false to disable

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
setSessionIdContextback to summary
public boolean setSessionIdContext(byte[] sidCtx)

Set the context within which session be reused (server side only) See man SSL_CTX_set_session_id_context

Parameters
sidCtx:byte[]

can be any kind of binary data, it is therefore possible to use e.g. the name of the application and/or the hostname and/or service name

Returns:boolean

true if success, false otherwise.

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.

Parameters
keys:byte[]

The session ticket keys

statsback to summary
public OpenSSLSessionStats stats()
Returns:OpenSSLSessionStats

The statistics for this context.

org.apache.tomcat.util.net.openssl back to summary

private final Class OpenSSLSessionContext.EmptyEnumeration

extends Object
implements Enumeration<byte[]>
Class Inheritance
  • java.lang.Object
  • org.apache.tomcat.util.net.openssl.OpenSSLSessionContext.EmptyEnumeration
All Implemented Interfaces
java.util.Enumeration

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
hasMoreElements()

Implements java.util.Enumeration.hasMoreElements.

Tests if this enumeration contains more elements.

public byte[]
nextElement()

Implements java.util.Enumeration.nextElement.

Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

EmptyEnumerationback to summary
private EmptyEnumeration()

Method Detail

hasMoreElementsback to summary
public boolean hasMoreElements()

Implements java.util.Enumeration.hasMoreElements.

Doc from java.util.Enumeration.hasMoreElements.

Tests if this enumeration contains more elements.

Returns:boolean

true if and only if this enumeration object contains at least one more element to provide; false otherwise.

Annotations
@Override
nextElementback to summary
public byte[] nextElement()

Implements java.util.Enumeration.nextElement.

Doc from java.util.Enumeration.nextElement.

Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Returns:byte[]

the next element of this enumeration.

Annotations
@Override