()
| 33 | } |
| 34 | |
| 35 | func (cfg *TLSConfig) Get() (*tls.Config, error) { |
| 36 | if cfg.loader == nil { |
| 37 | return nil, nil |
| 38 | } |
| 39 | tlsCfg := cfg.baseCfg.Clone() |
| 40 | |
| 41 | err := cfg.loader.ConfigureTLS(tlsCfg) |
| 42 | if err != nil { |
| 43 | return nil, err |
| 44 | } |
| 45 | |
| 46 | return tlsCfg, nil |
| 47 | } |
| 48 | |
| 49 | // TLSDirective reads the TLS configuration and adds the reload handler to |
| 50 | // reread certificates on SIGUSR2. |
no test coverage detected