How filosottile/mkcert works
mkcert is a command-line tool for creating locally trusted development certificates. Its main workflow parses names and options, loads or creates a local CA, issues a certificate (or signs a supplied CSR), and writes certificate/key or PKCS#12 output. A separate install/uninstall workflow manages the CA in system, NSS browser, and Java trust stores. The excerpts show the command and certificate logic plus platform adapters; links to adapters represent platform-selected implementations, and unsampled workflow details are omitted.
Main entry points: main.go Install / uninstall · cert.go Certificate issuance · truststore_windows.go System trust adapter · truststore_linux.go Linux trust adapter
Components 18
CLI workflows
- CLI command
main.go - Name validation
main.go - Install / uninstall
main.go
CA and issuance
- CA files
cert.go - Load / create CA
cert.go - Certificate issuance
cert.go - CSR signing
cert.go - Key generation
cert.go - Certificate outputs
cert.go
Platform adapters
- System trust adapter
truststore_windows.go - Linux trust adapter
truststore_linux.go - macOS trust adapter
truststore_darwin.go - NSS / Firefox
truststore_nss.go - Java trust adapter
truststore_java.go
Other components
- Developer
- OS root store
- Browser certificate stores
- Java cacerts
Connections 23
- Developer → CLI command: runs
- CLI command → Name validation: validates names
- CLI command → Install / uninstall: dispatches mode
- CLI command → Load / create CA: loads CA
- Load / create CA → CA files: reads / writes
- CLI command → Certificate issuance: issues certificate
- CLI command → CSR signing: signs CSR
- Certificate issuance → Key generation: generates key
- Certificate issuance → CA files: uses CA
- CSR signing → CA files: uses CA
- Certificate issuance → Certificate outputs: writes PEM / P12
- CSR signing → Certificate outputs: writes certificate
- Install / uninstall → CA files: uses CA certificate
- Install / uninstall → System trust adapter: dispatches platform
- Install / uninstall → Linux trust adapter: dispatches platform
- Install / uninstall → macOS trust adapter: dispatches platform
- Install / uninstall → NSS / Firefox: installs / checks
- Install / uninstall → Java trust adapter: installs / checks
- System trust adapter → OS root store: updates
- Linux trust adapter → OS root store: updates
- macOS trust adapter → OS root store: updates
- NSS / Firefox → Browser certificate stores: updates via certutil
- Java trust adapter → Java cacerts: updates via keytool