Today, I discovered mkcert – a tool that generates valid TLS certificate. It works for any hostname or IP, including localhost. In this post, I will show you how to generate a valid PKCS12 format certificate using mkcert. Then, we will use that certificate in a Spring boot application.
We will start by installing mkcert on our local machine. If you are using Mac then we can use
brew package manager. For installation instructions specific to your OS you can refer to the documentation.
brew install mkcert
mkcert is installed, you can use its CLI to create and install a CA. To do that, run the following command.