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