Documentation
¶
Overview ¶
Package mkcert wraps the mkcert CLI (https://github.com/FiloSottile/mkcert) to provide a programmatic means of generating certificates for local services. mkcert output is parsed to find the certificate file locations and whether the CA is trusted.
The CA used and trust stores considered are controlled using the CAROOT and TRUST_STORES envvars mkcert wants. See mkcert -help for more.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoDomains is returned by Gen to indicate no domains were requested. // mkcert will not be invoked. ErrNoDomains = errors.New("mkcert: no domains specified") )
Functions ¶
This section is empty.
Types ¶
type Cert ¶
type Cert struct { // CARoot is the mkcert directory containing its root CA. CARoot string // Trusted indicates that the root CA is installed in all of the system // trust stores. If not, the user will need to run 'mkcert -install' to // ensure their browser trusts the certificate we have generated. Trusted bool // Domains the certificate covers. Domains []string // File is the filepath of the certificate file. File string // KeyFile is the filepath of the private key. KeyFile string }
Cert points to the certificates generated by mkcert, with additional CA and trust info.
type Opt ¶
type Opt func(*params)
func Directory ¶
Directory specifies the working directory of mkcert, and is the path relative to which CertFile and KeyFile are relative to, if specified. When blank, defaults to the current directory.
func RequireTrusted ¶
RequireTrusted indicates whether Exec errors if the CA is not trusted.