Provision provisions s.
(ctx caddy.Context)
| 69 | |
| 70 | // Provision provisions s. |
| 71 | func (s *Provider) Provision(ctx caddy.Context) error { |
| 72 | s.ctx = ctx |
| 73 | |
| 74 | // unpack the storage module to use, if different from the default |
| 75 | if s.Storage != nil { |
| 76 | val, err := ctx.LoadModule(s, "Storage") |
| 77 | if err != nil { |
| 78 | return fmt.Errorf("loading TLS storage module: %s", err) |
| 79 | } |
| 80 | cmStorage, err := val.(caddy.StorageConverter).CertMagicStorage() |
| 81 | if err != nil { |
| 82 | return fmt.Errorf("creating TLS storage configuration: %v", err) |
| 83 | } |
| 84 | s.storage = cmStorage |
| 85 | } |
| 86 | |
| 87 | // otherwise, use default storage |
| 88 | if s.storage == nil { |
| 89 | s.storage = ctx.Storage() |
| 90 | } |
| 91 | |
| 92 | return nil |
| 93 | } |
| 94 | |
| 95 | // Initialize sets the configuration for s and returns the starting keys. |
| 96 | func (s *Provider) Initialize(config *caddytls.SessionTicketService) ([][32]byte, error) { |
nothing calls this directly
no test coverage detected