diff --git a/README.md b/README.md index 6b47a0f4..fbaae043 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ mkcert is a simple tool for making locally-trusted development certificates. It requires no configuration. -``` +```sh $ mkcert -install Created a new local CA 💥 The local CA is now installed in the system trust store! ⚡️ @@ -23,90 +23,183 @@ The certificate is at "./example.com+5.pem" and the key at "./example.com+5-key.

Chrome and Firefox screenshot

-Using certificates from real certificate authorities (CAs) for development can be dangerous or impossible (for hosts like `example.test`, `localhost` or `127.0.0.1`), but self-signed certificates cause trust errors. Managing your own CA is the best solution, but usually involves arcane commands, specialized knowledge and manual steps. +Using certificates from real certificate authorities (CAs) for development can be dangerous or impossible (for hosts like `example.test`, `localhost`, or `127.0.0.1`), but self-signed certificates cause trust errors. Managing your own CA is the best solution, but it usually involves arcane commands, specialized knowledge, and manual steps. mkcert automatically creates and installs a local CA in the system root store, and generates locally-trusted certificates. mkcert does not automatically configure servers to use the certificates, though, that's up to you. ## Installation -> **Warning**: the `rootCA-key.pem` file that mkcert automatically generates gives complete power to intercept secure requests from your machine. Do not share it. +> [!WARNING] +> **Do not share the `rootCA-key.pem` file!** This file gives complete power to intercept secure requests from your machine. -### macOS +
+macOS -On macOS, use [Homebrew](https://brew.sh/) +
+Homebrew -``` +See [Homebrew](https://brew.sh/). + +```sh brew install mkcert -brew install nss # if you use Firefox +# If you use Firefox: +brew install nss ``` +
-or [MacPorts](https://www.macports.org/). +
+MacPorts -``` +See [MacPorts](https://www.macports.org). + +```sh sudo port selfupdate sudo port install mkcert -sudo port install nss # if you use Firefox +# If you use Firefox: +sudo port install nss ``` +
-### Linux +
-On Linux, first install `certutil`. +
+Linux -``` +
+APT (Debian, Ubuntu, ...) + +First, install `certutil`: + +```sh sudo apt install libnss3-tools - -or- -sudo yum install nss-tools - -or- +``` + +Then, install `mkcert`: + +```sh +sudo apt install mkcert +``` +
+ +
+pacman (Arch, ...) + +First, install `certutil`: + +```sh sudo pacman -S nss - -or- -sudo zypper install mozilla-nss-tools ``` -Then you can install using [Homebrew on Linux](https://docs.brew.sh/Homebrew-on-Linux) +Then, install `mkcert`: +```sh +sudo pacman -Syu mkcert ``` -brew install mkcert +
+ +
+Yum (Fedora, ...) + +First, install `certutil`: + +```sh +sudo yum install nss-tools ``` -or build from source (requires Go 1.13+) +Then, follow the [alternative steps below](#linux-alternative). +
+ +
+Zypper (openSUSE, ...) + +First, install `certutil`: +```sh +sudo zypper install mozilla-nss-tools ``` -git clone https://github.com/FiloSottile/mkcert && cd mkcert -go build -ldflags "-X main.Version=$(git describe --tags)" + +Then, follow the [alternative steps below](#linux-alternative). +
+ +#### Linux (Alternative) + +
+Homebrew on Linux + +See [Homebrew on Linux](https://docs.brew.sh/Homebrew-on-Linux). + +```sh +brew install mkcert ``` +
-or use [the pre-built binaries](https://github.com/FiloSottile/mkcert/releases). +
+Build from source (requires Go 1.13+) +```sh +git clone https://github.com/FiloSottile/mkcert +cd mkcert +go build -ldflags "-X main.Version=$(git describe --tags)" ``` +
+ +
+Use pre-built binaries + +See [pre-built binaries](https://github.com/FiloSottile/mkcert/releases). + +```sh curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64" chmod +x mkcert-v*-linux-amd64 sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert ``` +
-For Arch Linux users, [`mkcert`](https://www.archlinux.org/packages/community/x86_64/mkcert/) is available on the official Arch Linux repository. +
-``` -sudo pacman -Syu mkcert -``` +
+Windows -### Windows +
+Chocolatey -On Windows, use [Chocolatey](https://chocolatey.org) +See [Chocolatey](https://chocolatey.org). -``` +```sh choco install mkcert ``` +
-or use Scoop +
+Scoop -``` +See [Scoop](https://scoop.sh/). + +```sh scoop bucket add extras scoop install mkcert ``` +
+ +#### Windows (Alternative) + +
+Build from source (requires Go 1.10+) + +```sh + +``` +
+ +
+Use pre-built binaries + +See [pre-built binaries](https://github.com/FiloSottile/mkcert/releases). +
-or build from source (requires Go 1.10+), or use [the pre-built binaries](https://github.com/FiloSottile/mkcert/releases). +If you're encountering permission problems, try running `mkcert` as an Administrator. -If you're running into permission problems try running `mkcert` as an Administrator. +
## Supported root stores @@ -165,7 +258,7 @@ mkcert filippo@example.com ### Mobile devices -For the certificates to be trusted on mobile devices, you will have to install the root CA. It's the `rootCA.pem` file in the folder printed by `mkcert -CAROOT`. +For the certificates to be trusted on mobile devices, you must install the root CA. It's the `rootCA.pem` file in the folder printed by `mkcert -CAROOT`. On iOS, you can either use AirDrop, email the CA to yourself, or serve it from an HTTP server. After opening it, you need to [install the profile in Settings > Profile Downloaded](https://github.com/FiloSottile/mkcert/issues/233#issuecomment-690110809) and then [enable full trust in it](https://support.apple.com/en-nz/HT204477). @@ -181,13 +274,13 @@ export NODE_EXTRA_CA_CERTS="$(mkcert -CAROOT)/rootCA.pem" ### Changing the location of the CA files -The CA certificate and its key are stored in an application data folder in the user home. You usually don't have to worry about it, as installation is automated, but the location is printed by `mkcert -CAROOT`. +The CA certificate and its key are stored in an application data folder in the user home. You usually don't have to worry about it, as the installation is automated, but the location is printed by `mkcert -CAROOT`. -If you want to manage separate CAs, you can use the environment variable `$CAROOT` to set the folder where mkcert will place and look for the local CA files. +If you want to manage separate CAs, use the environment variable `$CAROOT` to set the folder where mkcert will place and look for the local CA files. ### Installing the CA on other systems -Installing in the trust store does not require the CA key, so you can export the CA certificate and use mkcert to install it in other machines. +Installing in the trust store does not require the CA key, so you can export the CA certificate and use mkcert to install it on other machines. * Look for the `rootCA.pem` file in `mkcert -CAROOT` * copy it to a different machine