MCPcopy
hub / github.com/caddyserver/caddy / UnmarshalCaddyfile

Method UnmarshalCaddyfile

modules/caddytls/capools.go:354–369  ·  view source on GitHub ↗

Syntax: trust_pool pki_intermediate [<ca_name>...] { authority <ca_name>... } The 'authority' directive can be specified multiple times.

(d *caddyfile.Dispenser)

Source from the content-addressed store, hash-verified

352//
353// The 'authority' directive can be specified multiple times.
354func (pic *PKIIntermediateCAPool) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
355 d.Next() // consume module name
356 pic.Authority = append(pic.Authority, d.RemainingArgs()...)
357 for nesting := d.Nesting(); d.NextBlock(nesting); {
358 switch d.Val() {
359 case "authority":
360 pic.Authority = append(pic.Authority, d.RemainingArgs()...)
361 default:
362 return d.Errf("unrecognized directive: %s", d.Val())
363 }
364 }
365 if len(pic.Authority) == 0 {
366 return d.Err("no authorities specified")
367 }
368 return nil
369}
370
371// return the certificate pool generated with intermediate certificates from the PKI app
372func (p PKIIntermediateCAPool) CertPool() *x509.CertPool {

Calls 7

RemainingArgsMethod · 0.80
NestingMethod · 0.80
NextBlockMethod · 0.80
ValMethod · 0.80
ErrfMethod · 0.80
ErrMethod · 0.80
NextMethod · 0.65