mkcert, you changed my life!!

Shriram Sharma
2 min readJun 20, 2019

Ok, I agree, the title was a bit of an exaggeration but man I was blown away when I was introduced to it just a few weeks back.

Almost all the web servers or microservices that I create, even locally, are secure. That is, they can only be accessed through https (https://localhost:8443/).

In order to achieve that, I follow these steps and run a bunch of openssl commands.

  1. Create a local CA (Certificate Authority)
  2. Generate a Root Certificate and install it on your device and browsers.
  3. Generate Certificates using your local CA
  4. Use the generated Certificates in your web server
  5. Done!!

Please note, this post in no way undermines the power of openssl. I use opensslevery freaking day. It is awesome!!

Though all these steps are pretty easy, setting them up can be a little taxing. I had created a cheat sheet of all the openssl commands and each time I would say to myself, “I need to create a script for this”.

But then, just a few weeks back while I was attending a local meetup, someone introduced me tomkcert and oh boy! I got so excited. All the steps listed above basically shrunk down to two commands.

mkcert

Here’s where you can find mkcert and as of now it has freaking 19K stars. After installing mkcert , all I had to do was

$ mkcert localhost mysimpleproxy.com

--

--