Securing the server side is one thing; registering a secure application is something else. Let's look at how we can do this:
- To enable SSL for a Spring Boot application, we need to start with generating a self-signed certificate. I recommend you use keytool for that, which is available under your JRE root in the bin catalog:
keytool -genkey -alias client -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 3650
- Enter the required data and copy the generated keystore file keystore.p12 to your application's src/main/resources catalog. The next step is to enable HTTPS for Spring Boot using configuration properties in application.yml:
server: port: ${PORT:8081} ssl: key-store: classpath:keystore.p12 ...