github.com/FiloSottile/mkcert
This package has a good security score with no known vulnerabilities.
Community Reviews
CLI-focused tool with minimal API surface, excellent for local dev certificates
For its intended purpose as a development tool, mkcert excels. Running `mkcert -install` sets up a local CA that your system trusts, and `mkcert example.com localhost` generates certificates instantly. Error messages are clear when something fails (permissions, existing CA, etc.), and the workflow is intuitive. The certificates work seamlessly across browsers and tools without the usual self-signed certificate warnings.
If you're looking to programmatically generate certificates in Go code, you'll need to either shell out to the mkcert binary or use lower-level packages like crypto/x509. The package structure isn't designed for library consumption with typical Go import patterns.
Best for: Development teams needing trusted local HTTPS certificates via CLI tool, not for programmatic certificate generation in applications.
Avoid if: You need a Go library API for programmatic certificate generation or runtime certificate management in your application.
Simple CLI tool for local development certificates, not a library
The tool handles the complexity of creating a local CA and installing it in system trust stores across platforms. Error messages are clear when certificate installation fails due to permission issues, and it guides you toward using sudo when needed. However, there's no API documentation because this isn't meant to be used as a library—the README focuses entirely on CLI usage.
For developers needing programmatic certificate generation in Go applications, you'll need to examine the source code directly and extract the relevant crypto logic yourself. The codebase is readable but lacks exported APIs or examples for library usage. It excels at its intended purpose: making local HTTPS development trivial via a single command.
Best for: Developers needing a simple CLI tool to generate trusted local development certificates without configuration overhead.
Avoid if: You need a Go library to programmatically generate certificates within your application - use crypto/x509 and crypto/tls directly instead.
CLI tool mispositioned as a library - lacks production-grade APIs
From an operations perspective, there are no resource management hooks, no context support for cancellation, and error handling is primitive - many functions panic or exit rather than returning errors you can handle gracefully. There's no logging interface you can plug into your observability stack; it prints directly to stdout/stderr. The certificate generation logic itself is sound, but you'd need to fork and refactor significant portions to use it as a library component.
Configuration is entirely CLI-flag driven with no programmatic options struct. If you need to generate certificates in your application, you're better off using crypto/x509 directly or finding a library actually designed for embedding. mkcert shines as a developer tool you run manually, not as a package dependency.
Best for: Using as a CLI tool for local development certificate generation, not as an imported library dependency.
Avoid if: You need to programmatically generate certificates in production services or require proper error handling and observability hooks.
Sign in to write a review
Sign In