Syntax: trust_pool file [<pem_file>...] { pem_file <pem_file>... } The 'pem_file' directive can be specified multiple times.
(d *caddyfile.Dispenser)
| 183 | // |
| 184 | // The 'pem_file' directive can be specified multiple times. |
| 185 | func (fcap *FileCAPool) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { |
| 186 | d.Next() // consume module name |
| 187 | fcap.TrustedCACertPEMFiles = append(fcap.TrustedCACertPEMFiles, d.RemainingArgs()...) |
| 188 | for d.NextBlock(0) { |
| 189 | switch d.Val() { |
| 190 | case "pem_file": |
| 191 | fcap.TrustedCACertPEMFiles = append(fcap.TrustedCACertPEMFiles, d.RemainingArgs()...) |
| 192 | default: |
| 193 | return d.Errf("unrecognized directive: %s", d.Val()) |
| 194 | } |
| 195 | } |
| 196 | if len(fcap.TrustedCACertPEMFiles) == 0 { |
| 197 | return d.Err("no certificates specified") |
| 198 | } |
| 199 | return nil |
| 200 | } |
| 201 | |
| 202 | func (f FileCAPool) CertPool() *x509.CertPool { |
| 203 | return f.pool |