19992017 Ericsson AB. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ssl ssl_session_cache_api.xml
ssl_session_cache_api TLS session cache API

Defines the API for the TLS session cache so that the data storage scheme can be replaced by defining a new callback module implementing this API.

A key to an entry in the session cache.

The opaque part of the key. Does not need to be handled by the callback.

The session data that is stored for each session.

delete(Cache, Key) -> _ Deletes a cache entry. Cache = session_cache_ref() Key = session_cache_key()

Deletes a cache entry. Is only called from the cache handling process.

foldl(Fun, Acc0, Cache) -> Acc Fun = fun() Acc0 = Acc = term() Cache = session_cache_ref()

Calls Fun(Elem, AccIn) on successive elements of the cache, starting with AccIn == Acc0. Fun/2 must return a new accumulator, which is passed to the next call. The function returns the final value of the accumulator. Acc0 is returned if the cache is empty.

init(Args) -> Cache Returns cache reference. Cache = session_cache_ref() Args = proplists:proplist()

Includes property {role, client | server}. Currently this is the only predefined property, there can also be user-defined properties. See also application environment variable session_cb_init_args.

Performs possible initializations of the cache and returns a reference to it that is used as parameter to the other API functions. Is called by the cache handling processes init function, hence putting the same requirements on it as a normal process init function. This function is called twice when starting the SSL application, once with the role client and once with the role server, as the SSL application must be prepared to take on both roles.

lookup(Cache, Key) -> Entry Looks up a cache entry. Cache = session_cache_ref() Key = session_cache_key() Session = session() | undefined

Looks up a cache entry. Is to be callable from any process.

select_session(Cache, PartialKey) -> [Session] Selects sessions that can be reused. Cache = session_cache_ref() PartialKey = partial_key() Session = session()

Selects sessions that can be reused. Is to be callable from any process.

size(Cache) -> integer() Returns the number of sessions in the cache. Cache = session_cache_ref()

Returns the number of sessions in the cache. If size exceeds the maximum number of sessions, the current cache entries will be invalidated regardless of their remaining lifetime. Is to be callable from any process.

terminate(Cache) -> _ Called by the process that handles the cache when it is about to terminate. Cache = session_cache_ref() As returned by init/0

Takes care of possible cleanup that is needed when the cache handling process terminates.

update(Cache, Key, Session) -> _ Caches a new session or updates an already cached one. Cache = session_cache_ref() Key = session_cache_key() Session = session()

Caches a new session or updates an already cached one. Is only called from the cache handling process.