Syntax: trust_pool http [<endpoints...>] { endpoints <endpoints...> tls <tls_config> } tls_config: ca <ca_module> insecure_skip_verify handshake_timeout <duration> server_name <name> renegotiation <never|once|freely> <ca_module> is the name of the CA module to source the tr
(d *caddyfile.Dispenser)
| 733 | // |
| 734 | // certificate pool and follows the syntax of the named CA module. |
| 735 | func (hcp *HTTPCertPool) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { |
| 736 | d.Next() // consume module name |
| 737 | hcp.Endpoints = append(hcp.Endpoints, d.RemainingArgs()...) |
| 738 | for nesting := d.Nesting(); d.NextBlock(nesting); { |
| 739 | switch d.Val() { |
| 740 | case "endpoints": |
| 741 | if d.CountRemainingArgs() == 0 { |
| 742 | return d.ArgErr() |
| 743 | } |
| 744 | hcp.Endpoints = append(hcp.Endpoints, d.RemainingArgs()...) |
| 745 | case "tls": |
| 746 | if hcp.TLS != nil { |
| 747 | return d.Err("tls block already defined") |
| 748 | } |
| 749 | hcp.TLS = new(TLSConfig) |
| 750 | if err := hcp.TLS.unmarshalCaddyfile(d); err != nil { |
| 751 | return err |
| 752 | } |
| 753 | default: |
| 754 | return d.Errf("unrecognized directive: %s", d.Val()) |
| 755 | } |
| 756 | } |
| 757 | |
| 758 | return nil |
| 759 | } |
| 760 | |
| 761 | // report error if the endpoints are not valid URLs |
| 762 | func (hcp HTTPCertPool) Validate() (err error) { |