Two way SSL Using Java and Spring
May 28, 2019
Before we start with two way SSL let’s understand what is single or one-way SSL
One way SSL
In one way SSL, only client validates the server to ensure that it receives data from the intended server. For implementing one-way SSL, server shares its public certificate with the clients.
Two Way SSL
Contrary to one-way SSL; in case of two-way SSL, both client and server authenticate each other to ensure that both parties involved in the communication are trusted. Both parties share their public certificates to each other and then verification/validation is performed based on that.
Two way SSL implementation using Java and Spring
- Create sslContext Bean
- Create Secure Rest Template Bean
- Inject RestTemplate bean and make HTTP request
We have created secured RestTemplate which can be used to make http request.