In Spring Boot 3.2.0, we're adding the ability for embedded web servers to hot-reload SSL certificates and keys. That means you can rotate your SSL trust material without restarting your application. Hot reloading is supported for Tomcat and Netty embedded web servers.
Let's see that in action!
First, we're going to create our SSL private key and matching certificate using OpenSSL:
mkdir certs
cd certs
openssl req -x509 -subj "/CN=demo-cert-1" -keyout demo.key -out demo.crt -sha256 -days 365 -nodes -newkey rsa
This creates a private key stored in certs/demo.key
and a matching (self-signed) certificate with the common name "demo-cert-1" in certs/demo.crt
…