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

Method UnmarshalCaddyfile

modules/caddytls/capools.go:269–284  ·  view source on GitHub ↗

Syntax: trust_pool pki_root [ ...] { authority ... } The 'authority' directive can be specified multiple times.

(d *caddyfile.Dispenser)

Source from the content-addressed store, hash-verified

267//
268// The 'authority' directive can be specified multiple times.
269func (pkir *PKIRootCAPool) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
270 d.Next() // consume module name
271 pkir.Authority = append(pkir.Authority, d.RemainingArgs()...)
272 for nesting := d.Nesting(); d.NextBlock(nesting); {
273 switch d.Val() {
274 case "authority":
275 pkir.Authority = append(pkir.Authority, d.RemainingArgs()...)
276 default:
277 return d.Errf("unrecognized directive: %s", d.Val())
278 }
279 }
280 if len(pkir.Authority) == 0 {
281 return d.Err("no authorities specified")
282 }
283 return nil
284}
285
286// return the certificate pool generated with root certificates from the PKI app
287func (p PKIRootCAPool) CertPool() *x509.CertPool {

Callers 1

Calls 7

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

Tested by 1