Install custom certificate with mkcert
Tagged
bash
, admin
Following my previous post about generating a custom root certificate and a
PKI. I will share today a small snippet to install your self made certificate on
your laptop (or fleet) to be used by the system or the browsers.
It works on OSX, Linux and Windows by using a nice hidden feature of mkcert
.
Following the documentation, we can see that we can install a certificate
from a custom location. The idea here will be to rename our custom certificate
to rootCA.pem
and pass the folder to the environment variable.
If I was starting from my previous post terraform directory,
I would run the following commands to install the certificate on my system:
cp {ca_certificate,rootCA}.pem
CAROOT="$(pwd)" mkcert -install
And that’s it! It should work out of the box, you can check by running curl
without
the need of the --cacert
option from now on.