Syntax: trust_pool inline { trust_der <base64_der_cert>... } The 'trust_der' directive can be specified multiple times.
(d *caddyfile.Dispenser)
| 93 | // |
| 94 | // The 'trust_der' directive can be specified multiple times. |
| 95 | func (icp *InlineCAPool) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { |
| 96 | d.Next() // consume module name |
| 97 | if d.CountRemainingArgs() > 0 { |
| 98 | return d.ArgErr() |
| 99 | } |
| 100 | for d.NextBlock(0) { |
| 101 | switch d.Val() { |
| 102 | case "trust_der": |
| 103 | icp.TrustedCACerts = append(icp.TrustedCACerts, d.RemainingArgs()...) |
| 104 | default: |
| 105 | return d.Errf("unrecognized directive: %s", d.Val()) |
| 106 | } |
| 107 | } |
| 108 | if len(icp.TrustedCACerts) == 0 { |
| 109 | return d.Err("no certificates specified") |
| 110 | } |
| 111 | return nil |
| 112 | } |
| 113 | |
| 114 | // CertPool implements CA. |
| 115 | func (icp InlineCAPool) CertPool() *x509.CertPool { |