mkcert — Zero-Config Local HTTPS Development Certificates
mkcert is a simple tool that creates locally-trusted development certificates with zero configuration. No more browser security warnings in local development — just run mkcert and get valid HTTPS for localhost and any custom domain.
先审查再安装
这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。
npx -y tokrepo@latest install 404fae4b-372b-11f1-9bc6-00163e2b0d79 --target codex先 dry-run,确认写入项后再运行此命令。
What it is
mkcert is a simple CLI tool that creates locally-trusted development certificates with zero configuration. It installs a local Certificate Authority in your system trust store, then generates certificates that browsers accept without warnings.
mkcert targets web developers who need HTTPS in local development for testing service workers, secure cookies, mixed content, or OAuth callbacks. It eliminates the pain of self-signed certificates and manual trust store management.
The project is actively maintained and suitable for both individual developers and teams looking to integrate it into their existing toolchain. Documentation and community support are available for onboarding.
How it saves time or tokens
Without mkcert, setting up local HTTPS involves generating a CA, creating certificates, adding the CA to multiple trust stores, and repeating this on each machine. mkcert does all of this with mkcert -install followed by mkcert localhost. No OpenSSL commands, no manual trust store edits, no browser restarts.
How to use
- Install mkcert via Homebrew (
brew install mkcert), Chocolatey, or download from GitHub releases. - Run
mkcert -installonce to create and install the local CA. - Run
mkcert localhost 127.0.0.1 ::1to generate certificate and key files. - Configure your dev server (Vite, webpack-dev-server, nginx) to use the generated
.pemfiles.
Example
# Install mkcert and set up the local CA
brew install mkcert
mkcert -install
# Generate certificates for local development
mkcert localhost 127.0.0.1 ::1 myapp.local
# Creates: localhost+3.pem and localhost+3-key.pem
# Use with Node.js
node -e "
const https = require('https');
const fs = require('fs');
https.createServer({
key: fs.readFileSync('localhost+3-key.pem'),
cert: fs.readFileSync('localhost+3.pem')
}, (req, res) => res.end('Hello HTTPS')).listen(443);
"
Related on TokRepo
- AI Tools for Coding — Development tools and local environment setup utilities.
- AI Tools for Security — Security tools including certificate management and TLS configuration.
Common pitfalls
- Sharing mkcert-generated certificates across machines. The CA is local to your machine. Certificates will not be trusted on other machines unless you export and install the CA there.
- Using mkcert certificates in production. They are signed by a local CA that public browsers do not trust. Use Let's Encrypt or a commercial CA for production.
- Forgetting to run
mkcert -installfirst. Without installing the local CA, generated certificates trigger the same browser warnings as self-signed certs. - Not reading the changelog before upgrading. Breaking changes between versions can cause unexpected failures in production. Pin your version and review release notes.
常见问题
Yes, for development. mkcert creates a local CA that only your machine trusts. The CA private key stays on your disk. Do not share the CA key file, as anyone with it could generate certificates your machine would trust.
Yes. mkcert supports macOS, Linux, and Windows. It handles trust store installation for each platform automatically, including Firefox's separate certificate store via NSS.
Yes. Mount the generated certificate files into your Docker container. For the container to trust the CA, you also need to mount the CA cert and run update-ca-certificates inside the container.
Self-signed certificates are not trusted by browsers and produce security warnings. mkcert installs a CA in your system trust store, so certificates it signs are trusted by all browsers on your machine without warnings.
Yes. Run `mkcert '*.myapp.local'` to generate a wildcard certificate. This is useful when your local development environment uses multiple subdomains.
引用来源 (3)
- mkcert GitHub— Zero-config locally-trusted development certificates
- mkcert README— Automatic trust store installation for all platforms
- Mozilla Server Side TLS— TLS certificate best practices
讨论
相关资产
Unsloth — 2x Faster Local LLM Training & Inference
Unsloth is a unified local interface for running and training AI models. 58.7K+ GitHub stars. 2x faster training with 70% less VRAM across 500+ models including Qwen, DeepSeek, Llama, Gemma. Web UI wi
Pomerium — Identity-Aware Zero Trust Access Proxy
Pomerium is an open source reverse proxy that provides secure, identity-aware access to internal applications without a VPN, implementing BeyondCorp-style zero trust networking with SSO integration.
cAdvisor — Real-Time Container Resource Monitoring by Google
Analyze container resource usage and performance with Google's cAdvisor. Native Docker support, Prometheus metrics export, and zero-config deployment for production container monitoring.
Ollama Model Library — Best AI Models for Local Use
Curated guide to the best models available on Ollama for coding, chat, and reasoning. Compare Llama, Mistral, Gemma, Phi, and Qwen models for local AI development.