public interface SessionCache
Session state can be put to the cache and later retrieved by the DTLS session's ID for resumption handshakes. The provided cache is required to be thread-safe because it will be accessed concurrently.
Note:get(SessionId) is called to validate session ids, if
DtlsConnectorConfig.getVerifyPeersOnResumptionThreshold() is larger
than 0. If the implementation is expensive, please ensure, that the
value is configured with 0. Otherwise, CLIENT_HELLOs with invalid
session ids may be spoofed and gets too expensive.| Modifier and Type | Method and Description |
|---|---|
SessionTicket |
get(SessionId id)
Gets a session from the cache.
|
void |
put(DTLSSession session)
Adds an established session to the cache.
|
void |
remove(SessionId id)
Removes a session from the cache.
|
void put(DTLSSession session)
session - The session to add.SessionTicket get(SessionId id)
DtlsConnectorConfig.getVerifyPeersOnResumptionThreshold() is
larger than 0. If this implementation is expensive, please
ensure, that the value is configured with 0. Otherwise,
CLIENT_HELLOs with invalid session ids may be spoofed and gets too
expensive.id - The session identifier to look up.null, if the cache does not contain a session with the
given ID. A returned ticket is to be destroyed after usage. The
session ticket can only be used for resumption handshakes.void remove(SessionId id)
id - The identifier of the session to remove.Copyright © 2023 Eclipse Foundation. All rights reserved.