User's Guide
Reference Manual
Release Notes
PDF
Top

Secure Socket Layer
Reference Manual
Version 4.1.4

Expand All
Contract All

Table of Contents

- ssl (App)
- ssl
  - Top of manual page
  - cipher_suites/0
  - cipher_suites/1
  - connect/2
  - connect/3
  - connect/3
  - connect/4
  - close/1
  - controlling_process/2
  - connection_info/1
  - format_error/1
  - getopts/1
  - getopts/2
  - listen/2
  - peercert/1
  - peername/1
  - recv/2
  - recv/3
  - renegotiate/1
  - send/2
  - setopts/2
  - shutdown/2
  - ssl_accept/1
  - ssl_accept/2
  - ssl_accept/2
  - ssl_accept/3
  - sockname/1
  - start/0
  - start/1
  - stop/0
  - transport_accept/1
  - transport_accept/2
  - versions/0
- old_ssl
  - Top of manual page
  - ciphers/0
  - close/1
  - connect/3
  - connect/4
  - connection_info/1
  - controlling_process/2
  - format_error/1
  - getopts/2
  - listen/2
  - peercert/1
  - peername/1
  - pid/1
  - recv/2
  - recv/3
  - seed/1
  - send/2
  - setopts/2
  - ssl_accept/1
  - ssl_accept/2
  - sockname/1
  - transport_accept/1
  - transport_accept/2
  - version/0
- ssl_session_cache_api
  - Top of manual page
  - delete/2
  - foldl/3
  - init/0
  - lookup/2
  - select_session/2
  - terminate/1
  - update/3

# ssl_session_cache_api

### MODULE

ssl_session_cache_api

### MODULE SUMMARY

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.

### Common Data Types

The following data types are used in the functions below:

cache_ref() = opaque()

key() = {partialkey(), session_id()}

partialkey() = opaque()

session_id() = binary()

session() = opaque()

### EXPORTS

delete(Cache, Key) -> _

Types:

Cache = cache_ref()
Key = key()

Deletes a cache entry. Will only be called from the cache handling process.

foldl(Fun, Acc0, Cache) -> Acc

Types:

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() -> opaque()

Types:

Performs possible initializations of the cache and returns a reference to it that will be used as parameter to the other api functions. Will be called by the cache handling processes init function, hence putting the same requirements on it as a normal process init function.

lookup(Cache, Key) -> Entry

Types:

Cache = cache_ref()
Key = key()
Entry = session() | undefined

Looks up a cache entry. Should be callable from any process.

select_session(Cache, PartialKey) -> [session()]

Types:

Cache = cache_ref()
PartialKey = partialkey()
Session = session()

Selects sessions that could be reused. Should be callable from any process.

terminate(Cache) -> _

Types:

Cache = term() - as returned by init/0

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

update(Cache, Key, Session) -> _

Types:

Cache = cache_ref()
Key = key()
Session = session()

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