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

Method Provision

modules/caddytls/internalissuer.go:68–94  ·  view source on GitHub ↗

Provision sets up the issuer.

(ctx caddy.Context)

Source from the content-addressed store, hash-verified

66
67// Provision sets up the issuer.
68func (iss *InternalIssuer) Provision(ctx caddy.Context) error {
69 iss.logger = ctx.Logger()
70
71 // set some defaults
72 if iss.CA == "" {
73 iss.CA = caddypki.DefaultCAID
74 }
75
76 // get a reference to the configured CA
77 appModule, err := ctx.App("pki")
78 if err != nil {
79 return err
80 }
81 pkiApp := appModule.(*caddypki.PKI)
82 ca, err := pkiApp.GetCA(ctx, iss.CA)
83 if err != nil {
84 return err
85 }
86 iss.ca = ca
87
88 // set any other default values
89 if iss.Lifetime == 0 {
90 iss.Lifetime = caddy.Duration(defaultInternalCertLifetime)
91 }
92
93 return nil
94}
95
96// IssuerKey returns the unique issuer key for the
97// configured CA endpoint.

Callers

nothing calls this directly

Calls 4

AppMethod · 0.80
GetCAMethod · 0.80
DurationMethod · 0.80
LoggerMethod · 0.45

Tested by

no test coverage detected