Debian Codegraph @

modules/caddytls/sessiontickets.go

raw symbols SCIP
1 // Copyright 2015 Matthew Holt and The Caddy Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 package caddytlsscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/
16
17 import (
18 "crypto/randscip-go gomod github.com/golang/go/src go1.25.1 `crypto/rand`/"
19 "crypto/tlsscip-go gomod github.com/golang/go/src go1.25.1 `crypto/tls`/"
20 "encoding/jsonscip-go gomod github.com/golang/go/src go1.25.1 `encoding/json`/"
21 "fmtscip-go gomod github.com/golang/go/src go1.25.1 fmt/"
22 "ioscip-go gomod github.com/golang/go/src go1.25.1 io/"
23 "logscip-go gomod github.com/golang/go/src go1.25.1 log/"
24 "runtime/debugscip-go gomod github.com/golang/go/src go1.25.1 `runtime/debug`/"
25 "syncscip-go gomod github.com/golang/go/src go1.25.1 sync/"
26 "timescip-go gomod github.com/golang/go/src go1.25.1 time/"
27
28 "github.com/caddyserver/caddy/v2scip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2`/"
29 )
30
31 // SessionTicketService configures and manages TLS session tickets.
32 type SessionTicketServicescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService# struct {
33 // KeySource is the method by which Caddy produces or obtains
34 // TLS session ticket keys (STEKs). By default, Caddy generates
35 // them internally using a secure pseudorandom source.
36 KeySourcescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#KeySource. jsonscip-go gomod github.com/golang/go/src go1.25.1 `encoding/json`/.RawMessagescip-go gomod github.com/golang/go/src go1.25.1 `encoding/json`/RawMessage# `json:"key_source,omitempty" caddy:"namespace=tls.stek inline_key=provider"`
37
38 // How often Caddy rotates STEKs. Default: 12h.
39 RotationIntervalscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#RotationInterval. caddyscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2`/.Durationscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2`/Duration# `json:"rotation_interval,omitempty"`
40
41 // The maximum number of keys to keep in rotation. Default: 4.
42 MaxKeysscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#MaxKeys. int `json:"max_keys,omitempty"`
43
44 // Disables STEK rotation.
45 DisableRotationscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#DisableRotation. bool `json:"disable_rotation,omitempty"`
46
47 // Disables TLS session resumption by tickets.
48 Disabledscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#Disabled. bool `json:"disabled,omitempty"`
49
50 keySourcescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#keySource. STEKProviderscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/STEKProvider#
51 configsscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#configs. map[*tlsscip-go gomod github.com/golang/go/src go1.25.1 `crypto/tls`/.Configscip-go gomod github.com/golang/go/src go1.25.1 `crypto/tls`/Config#]struct{}
52 stopChanscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#stopChan. chan struct{}
53 currentKeysscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#currentKeys. [][32]byte
54 muscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#mu. *syncscip-go gomod github.com/golang/go/src go1.25.1 sync/.Mutexscip-go gomod github.com/golang/go/src go1.25.1 sync/Mutex#
55 }
56
57 func (s *SessionTicketServicescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#) provisionscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#provision().(ctx caddyscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2`/.Contextscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2`/Context#) error {
58 s.configsscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#configs. = make(map[*tlsscip-go gomod github.com/golang/go/src go1.25.1 `crypto/tls`/.Configscip-go gomod github.com/golang/go/src go1.25.1 `crypto/tls`/Config#]struct{})
59 s.muscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#mu. = new(syncscip-go gomod github.com/golang/go/src go1.25.1 sync/.Mutexscip-go gomod github.com/golang/go/src go1.25.1 sync/Mutex#)
60
61 // establish sane defaults
62 if s.RotationIntervalscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#RotationInterval. == 0 {
63 s.RotationIntervalscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#RotationInterval. = caddyscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2`/.Durationscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2`/Duration#(defaultSTEKRotationIntervalscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/defaultSTEKRotationInterval.)
64 }
65 if s.MaxKeysscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#MaxKeys. <= 0 {
66 s.MaxKeysscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#MaxKeys. = defaultMaxSTEKsscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/defaultMaxSTEKs.
67 }
68 if s.KeySourcescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#KeySource. == nil {
69 s.KeySourcescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#KeySource. = jsonscip-go gomod github.com/golang/go/src go1.25.1 `encoding/json`/.RawMessagescip-go gomod github.com/golang/go/src go1.25.1 `encoding/json`/RawMessage#(`{"provider":"standard"}`)
70 }
71
72 // load the STEK module, which will provide keys
73 val, err := ctx.LoadModulescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2`/Context#LoadModule().(s, "KeySource")
74 if err != nil {
75 return fmtscip-go gomod github.com/golang/go/src go1.25.1 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.25.1 fmt/Errorf().("loading TLS session ticket ephemeral keys provider module: %s", err)
76 }
77 s.keySourcescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#keySource. = val.(STEKProviderscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/STEKProvider#)
78
79 // if session tickets or just rotation are
80 // disabled, no need to start service
81 if s.Disabledscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#Disabled. || s.DisableRotationscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#DisableRotation. {
82 return nil
83 }
84
85 // start the STEK module; this ensures we have
86 // a starting key before any config needs one
87 return s.startscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#start().()
88 }
89
90 // start loads the starting STEKs and spawns a goroutine
91 // which loops to rotate the STEKs, which continues until
92 // stop() is called. If start() was already called, this
93 // is a no-op.
94 func (s *SessionTicketServicescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#) startscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#start().() error {
95 if s.stopChanscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#stopChan. != nil {
96 return nil
97 }
98 s.stopChanscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#stopChan. = make(chan struct{})
99
100 // initializing the key source gives us our
101 // initial key(s) to start with; if successful,
102 // we need to be sure to call Next() so that
103 // the key source can know when it is done
104 initialKeys, err := s.keySourcescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#keySource..Initializescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/STEKProvider#Initialize.(s)
105 if err != nil {
106 return fmtscip-go gomod github.com/golang/go/src go1.25.1 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.25.1 fmt/Errorf().("setting STEK module configuration: %v", err)
107 }
108
109 s.muscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#mu..Lockscip-go gomod github.com/golang/go/src go1.25.1 sync/Mutex#Lock().()
110 s.currentKeysscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#currentKeys. = initialKeys
111 s.muscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#mu..Unlockscip-go gomod github.com/golang/go/src go1.25.1 sync/Mutex#Unlock().()
112
113 // keep the keys rotated
114 go s.stayUpdatedscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#stayUpdated().()
115
116 return nil
117 }
118
119 // stayUpdated is a blocking function which rotates
120 // the keys whenever new ones are sent. It reads
121 // from keysChan until s.stop() is called.
122 func (s *SessionTicketServicescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#) stayUpdatedscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#stayUpdated().() {
123 defer func() {
124 if err := recover(); err != nil {
125 logscip-go gomod github.com/golang/go/src go1.25.1 log/.Printfscip-go gomod github.com/golang/go/src go1.25.1 log/Printf().("[PANIC] session ticket service: %v\n%s", err, debugscip-go gomod github.com/golang/go/src go1.25.1 `runtime/debug`/.Stackscip-go gomod github.com/golang/go/src go1.25.1 `runtime/debug`/Stack().())
126 }
127 }()
128
129 // this call is essential when Initialize()
130 // returns without error, because the stop
131 // channel is the only way the key source
132 // will know when to clean up
133 keysChan := s.keySourcescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#keySource..Nextscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/STEKProvider#Next.(s.stopChanscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#stopChan.)
134
135 for {
136 select {
137 case newKeys := <-keysChan:
138 s.muscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#mu..Lockscip-go gomod github.com/golang/go/src go1.25.1 sync/Mutex#Lock().()
139 s.currentKeysscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#currentKeys. = newKeys
140 for cfg := range s.configsscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#configs. {
141 cfg.SetSessionTicketKeysscip-go gomod github.com/golang/go/src go1.25.1 `crypto/tls`/Config#SetSessionTicketKeys().(newKeys)
142 }
143 s.muscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#mu..Unlockscip-go gomod github.com/golang/go/src go1.25.1 sync/Mutex#Unlock().()
144 case <-s.stopChanscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#stopChan.:
145 return
146 }
147 }
148 }
149
150 // stop terminates the key rotation goroutine.
151 func (s *SessionTicketServicescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#) stopscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#stop().() {
152 if s.stopChanscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#stopChan. != nil {
153 close(s.stopChanscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#stopChan.)
154 }
155 }
156
157 // register sets the session ticket keys on cfg
158 // and keeps them updated. Any values registered
159 // must be unregistered, or they will not be
160 // garbage-collected. s.start() must have been
161 // called first. If session tickets are disabled
162 // or if ticket key rotation is disabled, this
163 // function is a no-op.
164 func (s *SessionTicketServicescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#) registerscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#register().(cfg *tlsscip-go gomod github.com/golang/go/src go1.25.1 `crypto/tls`/.Configscip-go gomod github.com/golang/go/src go1.25.1 `crypto/tls`/Config#) {
165 if s.Disabledscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#Disabled. || s.DisableRotationscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#DisableRotation. {
166 return
167 }
168 s.muscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#mu..Lockscip-go gomod github.com/golang/go/src go1.25.1 sync/Mutex#Lock().()
169 cfg.SetSessionTicketKeysscip-go gomod github.com/golang/go/src go1.25.1 `crypto/tls`/Config#SetSessionTicketKeys().(s.currentKeysscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#currentKeys.)
170 s.configsscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#configs.[cfg] = struct{}{}
171 s.muscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#mu..Unlockscip-go gomod github.com/golang/go/src go1.25.1 sync/Mutex#Unlock().()
172 }
173
174 // unregister stops session key management on cfg and
175 // removes the internal stored reference to cfg. If
176 // session tickets are disabled or if ticket key rotation
177 // is disabled, this function is a no-op.
178 func (s *SessionTicketServicescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#) unregisterscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#unregister().(cfg *tlsscip-go gomod github.com/golang/go/src go1.25.1 `crypto/tls`/.Configscip-go gomod github.com/golang/go/src go1.25.1 `crypto/tls`/Config#) {
179 if s.Disabledscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#Disabled. || s.DisableRotationscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#DisableRotation. {
180 return
181 }
182 s.muscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#mu..Lockscip-go gomod github.com/golang/go/src go1.25.1 sync/Mutex#Lock().()
183 delete(s.configsscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#configs., cfg)
184 s.muscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#mu..Unlockscip-go gomod github.com/golang/go/src go1.25.1 sync/Mutex#Unlock().()
185 }
186
187 // RotateSTEKs rotates the keys in keys by producing a new key and eliding
188 // the oldest one. The new slice of keys is returned.
189 func (s SessionTicketServicescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#) RotateSTEKsscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#RotateSTEKs().(keys [][32]byte) ([][32]byte, error) {
190 // produce a new key
191 newKey, err := s.generateSTEKscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#generateSTEK().()
192 if err != nil {
193 return nil, fmtscip-go gomod github.com/golang/go/src go1.25.1 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.25.1 fmt/Errorf().("generating STEK: %v", err)
194 }
195
196 // we need to prepend this new key to the list of
197 // keys so that it is preferred, but we need to be
198 // careful that we do not grow the slice larger
199 // than MaxKeys, otherwise we'll be storing one
200 // more key in memory than we expect; so be sure
201 // that the slice does not grow beyond the limit
202 // even for a brief period of time, since there's
203 // no guarantee when that extra allocation will
204 // be overwritten; this is why we first trim the
205 // length to one less the max, THEN prepend the
206 // new key
207 if len(keys) >= s.MaxKeysscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#MaxKeys. {
208 keys[len(keys)-1] = [32]byte{} // zero-out memory of oldest key
209 keys = keys[:s.MaxKeysscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#MaxKeys.-1] // trim length of slice
210 }
211 keys = append([][32]byte{newKey}, keys...) // prepend new key
212
213 return keys, nil
214 }
215
216 // generateSTEK generates key material suitable for use as a
217 // session ticket ephemeral key.
218 func (s *SessionTicketServicescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#) generateSTEKscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#generateSTEK().() ([32]byte, error) {
219 var newTicketKey [32]byte
220 _, err := ioscip-go gomod github.com/golang/go/src go1.25.1 io/.ReadFullscip-go gomod github.com/golang/go/src go1.25.1 io/ReadFull().(randscip-go gomod github.com/golang/go/src go1.25.1 `crypto/rand`/.Readerscip-go gomod github.com/golang/go/src go1.25.1 `crypto/rand`/Reader., newTicketKey[:])
221 return newTicketKey, err
222 }
223
224 // STEKProvider is a type that can provide session ticket ephemeral
225 // keys (STEKs).
226 type STEKProviderscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/STEKProvider# interface {
227 // Initialize provides the STEK configuration to the STEK
228 // module so that it can obtain and manage keys accordingly.
229 // It returns the initial key(s) to use. Implementations can
230 // rely on Next() being called if Initialize() returns
231 // without error, so that it may know when it is done.
232 Initializescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/STEKProvider#Initialize.(config *SessionTicketServicescip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/SessionTicketService#) ([][32]byte, error)
233
234 // Next returns the channel through which the next session
235 // ticket keys will be transmitted until doneChan is closed.
236 // Keys should be sent on keysChan as they are updated.
237 // When doneChan is closed, any resources allocated in
238 // Initialize() must be cleaned up.
239 Nextscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/STEKProvider#Next.(doneChan <-chan struct{}) (keysChan <-chan [][32]byte)
240 }
241
242 const (
243 defaultSTEKRotationIntervalscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/defaultSTEKRotationInterval. = 12 * timescip-go gomod github.com/golang/go/src go1.25.1 time/.Hourscip-go gomod github.com/golang/go/src go1.25.1 time/Hour.
244 defaultMaxSTEKsscip-go gomod github.com/caddyserver/caddy/v2 . `github.com/caddyserver/caddy/v2/modules/caddytls`/defaultMaxSTEKs. = 4
245 )