APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.security.ssl

pack-priv final Class SSLSessionContextImpl

extends Object
implements SSLSessionContext
Class Inheritance
All Implemented Interfaces
javax.net.ssl.SSLSessionContext
Imports
java.util.ArrayList, .Collections, .Enumeration, .Iterator, .Locale, .Map, .Random, java.util.concurrent.ConcurrentHashMap, javax.net.ssl.SSLSession, .SSLSessionContext, sun.security.util.Cache, .KeyUtil

jdk.tls.server.enableSessionTicketExtension determines if the server will provide stateless session tickets, if the client supports it, as described in RFC 5077 and RFC 8446. a stateless session ticket contains the encrypted server's state which saves server resources. jdk.tls.client.enableSessionTicketExtension determines if the client will send an extension in the ClientHello in the pre-TLS 1.3. This extension allows the client to accept the server's session state for Server Side stateless resumption (RFC 5077). Setting the property to "false" turns this off, by default it is true. For TLS 1.3, the system property is not needed as this support is part of the spec. jdk.tls.server.sessionTicketTimeout determines how long a session in the server cache or the stateless resumption tickets are available for use. The value set by the property can be modified by SSLSessionContext.setSessionTimeout() during runtime.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private int
private int
private static final int
private static final int
pack-priv static final int
private final Map<Integer, SessionTicketExtension.StatelessKey>
private final Cache<SessionId, SSLSessionImpl>
private final Cache<String, SSLSessionImpl>
private boolean
private int

Constructor Summary

AccessConstructor and Description
pack-priv
SSLSessionContextImpl(boolean server)

Method Summary

Modifier and TypeMethod and Description
private void
pack-priv SSLSessionImpl
get(byte[] id)

pack-priv SSLSessionImpl
get(String hostname, int port)

private int
getDefaults(boolean server)

public Enumeration<byte[]>
getIds()

Implements javax.net.ssl.SSLSessionContext.getIds.

Returns an enumeration of the active SSL sessions.

pack-priv SessionTicketExtension.StatelessKey
pack-priv SessionTicketExtension.StatelessKey
getKey(int id)

private static String
getKey(String hostname, int port)

public SSLSession
getSession(byte[] sessionId)

Implements javax.net.ssl.SSLSessionContext.getSession.

Returns the SSLSession bound to the specified session id.

public int
getSessionCacheSize()

Implements javax.net.ssl.SSLSessionContext.getSessionCacheSize.

Gets the size of the cache used for storing SSLSession objects.

public int
getSessionTimeout()

Implements javax.net.ssl.SSLSessionContext.getSessionTimeout.

Gets the timeout limit for cached SSLSession objects

private boolean
pack-priv SSLSessionImpl
pull(byte[] id)

pack-priv void
pack-priv void
put(SSLSessionImpl
SSLSessionImpl entry to be stored
s
,
boolean
True if multiple entries may exist under one session entry.
canQueue
)

Put an entry in the cache

pack-priv void
pack-priv void
remove(SessionId key, boolean isClient)

public void
setSessionCacheSize(int size)

Implements javax.net.ssl.SSLSessionContext.setSessionCacheSize.

Sets the size of the cache used for storing SSLSession objects.

public void
setSessionTimeout(int seconds)

Implements javax.net.ssl.SSLSessionContext.setSessionTimeout.

Sets the timeout limit for cached SSLSession objects Note that after reset the timeout, the cached session before should be timed within the shorter one of the old timeout and the new timeout.

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

Field Detail

cacheLimitback to summary
private int cacheLimit
currentKeyIDback to summary
private int currentKeyID
DEFAULT_MAX_CACHE_SIZEback to summary
private static final int DEFAULT_MAX_CACHE_SIZE
DEFAULT_MAX_QUEUE_SIZEback to summary
private static final int DEFAULT_MAX_QUEUE_SIZE
DEFAULT_SESSION_TIMEOUTback to summary
pack-priv static final int DEFAULT_SESSION_TIMEOUT
keyHashMapback to summary
private final Map<Integer, SessionTicketExtension.StatelessKey> keyHashMap
sessionCacheback to summary
private final Cache<SessionId, SSLSessionImpl> sessionCache
sessionHostPortCacheback to summary
private final Cache<String, SSLSessionImpl> sessionHostPortCache
statelessSessionback to summary
private boolean statelessSession
timeoutback to summary
private int timeout

Constructor Detail

SSLSessionContextImplback to summary
pack-priv SSLSessionContextImpl(boolean server)

Method Detail

cleanupStatelessKeysback to summary
private void cleanupStatelessKeys()
getback to summary
pack-priv SSLSessionImpl get(byte[] id)
getback to summary
pack-priv SSLSessionImpl get(String hostname, int port)
getDefaultsback to summary
private int getDefaults(boolean server)
getIdsback to summary
public Enumeration<byte[]> getIds()

Implements javax.net.ssl.SSLSessionContext.getIds.

Returns an enumeration of the active SSL sessions.

Annotations
@Override
getKeyback to summary
pack-priv SessionTicketExtension.StatelessKey getKey(HandshakeContext hc)
getKeyback to summary
pack-priv SessionTicketExtension.StatelessKey getKey(int id)
getKeyback to summary
private static String getKey(String hostname, int port)
getSessionback to summary
public SSLSession getSession(byte[] sessionId)

Implements javax.net.ssl.SSLSessionContext.getSession.

Returns the SSLSession bound to the specified session id.

Annotations
@Override
getSessionCacheSizeback to summary
public int getSessionCacheSize()

Implements javax.net.ssl.SSLSessionContext.getSessionCacheSize.

Gets the size of the cache used for storing SSLSession objects.

Annotations
@Override
getSessionTimeoutback to summary
public int getSessionTimeout()

Implements javax.net.ssl.SSLSessionContext.getSessionTimeout.

Gets the timeout limit for cached SSLSession objects

Annotations
@Override
isTimedoutback to summary
private boolean isTimedout(SSLSession sess)
pullback to summary
pack-priv SSLSessionImpl pull(byte[] id)
putback to summary
pack-priv void put(SSLSessionImpl s)
putback to summary
pack-priv void put(SSLSessionImpl s, boolean canQueue)

Put an entry in the cache

Parameters
s:SSLSessionImpl

SSLSessionImpl entry to be stored

canQueue:boolean

True if multiple entries may exist under one session entry.

removeback to summary
pack-priv void remove(SessionId key)
removeback to summary
pack-priv void remove(SessionId key, boolean isClient)
setSessionCacheSizeback to summary
public void setSessionCacheSize(int size) throws IllegalArgumentException

Implements javax.net.ssl.SSLSessionContext.setSessionCacheSize.

Sets the size of the cache used for storing SSLSession objects.

Annotations
@Override
Exceptions
IllegalArgumentException:

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

if the specified size is < 0.

setSessionTimeoutback to summary
public void setSessionTimeout(int seconds) throws IllegalArgumentException

Implements javax.net.ssl.SSLSessionContext.setSessionTimeout.

Sets the timeout limit for cached SSLSession objects Note that after reset the timeout, the cached session before should be timed within the shorter one of the old timeout and the new timeout.

Annotations
@Override
Exceptions
IllegalArgumentException:

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

if the timeout specified is < 0.

statelessEnabledback to summary
pack-priv boolean statelessEnabled()
sun.security.ssl back to summary

private final Class SSLSessionContextImpl.SessionCacheVisitor

extends Object
implements Cache.CacheVisitor<SessionId, SSLSessionImpl>
Class Inheritance
All Implemented Interfaces
sun.security.util.Cache.CacheVisitor

Field Summary

Modifier and TypeField and Description
pack-priv ArrayList<byte[]>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv Enumeration<byte[]>
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

idsback to summary
pack-priv ArrayList<byte[]> ids

Constructor Detail

SessionCacheVisitorback to summary
private SessionCacheVisitor()

Method Detail

getSessionIdsback to summary
pack-priv Enumeration<byte[]> getSessionIds()
visitback to summary
public void visit(Map<SessionId, SSLSessionImpl> map)

Implements sun.security.util.Cache.CacheVisitor.visit.

Annotations
@Override