1ssl_session_cache_api(3) Erlang Module Definition ssl_session_cache_api(3)
2
3
4
6 ssl_session_cache_api - TLS session cache API
7
9 Defines the API for the TLS session cache so that the data storage
10 scheme can be replaced by defining a new callback module implementing
11 this API.
12
14 The following data types are used in the functions for ssl_ses‐
15 sion_cache_api:
16
17 cache_ref() =:
18 opaque()
19
20 key() =:
21 {partialkey(), session_id()}
22
23 partialkey() =:
24 opaque()
25
26 session_id() =:
27 binary()
28
29 session() =:
30 opaque()
31
33 delete(Cache, Key) -> _
34
35 Types:
36
37 Cache = cache_ref()
38 Key = key()
39
40 Deletes a cache entry. Is only called from the cache handling
41 process.
42
43 foldl(Fun, Acc0, Cache) -> Acc
44
45 Types:
46
47
48
49 Calls Fun(Elem, AccIn) on successive elements of the cache,
50 starting with AccIn == Acc0. Fun/2 must return a new accumula‐
51 tor, which is passed to the next call. The function returns the
52 final value of the accumulator. Acc0 is returned if the cache is
53 empty.
54
55 init(Args) -> opaque()
56
57 Types:
58
59 Args = proplists:proplist()
60
61 Includes property {role, client | server}. Currently this is the
62 only predefined property, there can also be user-defined proper‐
63 ties. See also application environment variable ses‐
64 sion_cb_init_args.
65
66 Performs possible initializations of the cache and returns a
67 reference to it that is used as parameter to the other API func‐
68 tions. Is called by the cache handling processes init function,
69 hence putting the same requirements on it as a normal process
70 init function. This function is called twice when starting the
71 SSL application, once with the role client and once with the
72 role server, as the SSL application must be prepared to take on
73 both roles.
74
75 lookup(Cache, Key) -> Entry
76
77 Types:
78
79 Cache = cache_ref()
80 Key = key()
81 Entry = session() | undefined
82
83 Looks up a cache entry. Is to be callable from any process.
84
85 select_session(Cache, PartialKey) -> [session()]
86
87 Types:
88
89 Cache = cache_ref()
90 PartialKey = partialkey()
91 Session = session()
92
93 Selects sessions that can be reused. Is to be callable from any
94 process.
95
96 size(Cache) -> integer()
97
98 Types:
99
100 Cache = cache_ref()
101
102 Returns the number of sessions in the cache. If size exceeds the
103 maximum number of sessions, the current cache entries will be
104 invalidated regardless of their remaining lifetime. Is to be
105 callable from any process.
106
107 terminate(Cache) -> _
108
109 Types:
110
111 Cache = term() - as returned by init/0
112
113 Takes care of possible cleanup that is needed when the cache
114 handling process terminates.
115
116 update(Cache, Key, Session) -> _
117
118 Types:
119
120 Cache = cache_ref()
121 Key = key()
122 Session = session()
123
124 Caches a new session or updates an already cached one. Is only
125 called from the cache handling process.
126
127
128
129Ericsson AB ssl 8.2.6.4 ssl_session_cache_api(3)