How to Enable HTTPS in Spring Boot Application

We will use self-signed certificates in this tutorial

Ruby Valappil
Javarevisited

--

Photo by Phil Shaw on Unsplash

We have been developing Spring Boot apps for a while now and access our endpoints through HTTP protocol.

We have discussed HTTP in a few previous posts here and here.

This article will see what’s needed to turn an HTTP into an HTTPS endpoint. Then we will implement an endpoint in a Spring Boot application and make it available over HTTPS.

Let’s go through a few terms and concepts first.

SSL

SSL, a.k.a Secure Sockets Layer, is an internet security protocol that establishes security to data in transit between two computer devices.

SSL encrypts the data transmitted between multiple devices, making it nearly impossible to decrypt by bad actors.

SSL was later upgraded to TLS, but by then, the name SSL had become so popular that the certificates are still called SSL/TLS certificates.

SSL certificate

SSL certificate is used to identify a server. Clients use this certificate to verify if the server is really who it claims to be.

A Certificate consists of a public and private key pair. The private key is stored on the…

--

--