Serving Spring Boot HTTPS

How to put together Spring Boot 2, Nginx and Let's encrypt

This quick tutorial is assuming you already have a working installation of Let's Encrypt certificates in your site. We will go through the configuration of Nginx and your Spring Boot 2 application. If you need help to get the certificates working you can follow this guide or in Let's Encrypt documentation

Certificates

The first step will be to export your let's encrypt certificate to a suitable format and location.

Spring Boot expects PKCS12. We need to create a keystore. Doing that you will be asked to provide a password. This password needs to be provided to your Spring application as well (Find a secure way to do it. We are using application properties in this example for simplicity). The value under -name will be the alias of this key in the keystore.

So let's go hands on...

Read more

January 2020