Create a local certificate authority
Certificate authorities are holders of private/public keys that are known to be trusted.
The mkcert() utility was created to perform the tedious tasks of creating a root Certificate Authority public and private key-pair. It also adds the Certificate Authority to the local machine's general list of Certificate Authorities.
With mkcert() a Certificate Authority (CA) is generated simply by typing mkcert --install
In Ubuntu Linux, this CA key-pair is stored in your ~/.local/share/mkcert/
directory as rootCA.pem
and rootCA-key.pem
It also gets added to the /usr/local/share/ca-certificates/
directory as mkcert_development_CA_[longnumber].crt
After this, mkcert() runs the update-ca-certificates
utility that coalesces all of the certificates in /etc/ssl/certs/
and /usr/local/share/ca-certificates/
into one big file called /etc/ssl/certs/ca-certificates.crt
Import your new certificate authority into your browser
The new certificate authority may still not be trusted by your browser. To get past this barrier, go to Settings|Privacy and security|Security|Manage certificates|Authorities|Import
and select the certificate (not the key) to import into your browser. It may be useful to check the imported certificate's trust settings to ensure that it is trusted for websites. You will probably find it under org-mkcert development CA
Generate a certificate for a local development domain-name
After generating your root Certificate Authority with mkcert(), you can generate local server certificates by typing mkcert localdevname [localname2 ...]
This will generate a local key and certificate which can then be used by your HTTP server (such as NGINX) by adding these lines to your local server configuration block.
ssl_certificate /pathtocert/localdevname.pem;
ssl_certificate_key /pathtocert/localdevname-key.pem;