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

Method installRoot

modules/caddypki/ca.go:436–452  ·  view source on GitHub ↗

installRoot installs this CA's root certificate into the local trust store(s) if it is not already trusted. The CA must already be provisioned.

()

Source from the content-addressed store, hash-verified

434// local trust store(s) if it is not already trusted. The CA
435// must already be provisioned.
436func (ca CA) installRoot() error {
437 // avoid password prompt if already trusted
438 if trusted(ca.root) {
439 ca.log.Info("root certificate is already trusted by system",
440 zap.String("path", ca.rootCertPath))
441 return nil
442 }
443
444 ca.log.Warn("installing root certificate (you might be prompted for password)",
445 zap.String("path", ca.rootCertPath))
446
447 return truststore.Install(ca.root,
448 truststore.WithDebug(),
449 truststore.WithFirefox(),
450 truststore.WithJava(),
451 )
452}
453
454// AuthorityConfig is used to help a CA configure
455// the underlying signing authority.

Callers 2

cmdTrustFunction · 0.95
StartMethod · 0.80

Calls 2

trustedFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected