Simple Spring Boot app, that shows how to set up mutual (2 way) ssl authorization between server and client.
It's just a single endpoint that responds with 'Hello, ${your name}', and is only accessible if client provides known certificate.
For testing, you will be fine using provided certificates. However if you want to create your own- you can check the script in src/main/resources/ssl/cert.sh
.
We will use Postman for issuing requests.
- Start the server.
- Start Postman.
- Enter
https://localhost:8443/greeting?name=John
as url. Send request, it will fail. - Open Settings -> Certificates -> add new, enter
localhost:8443
as url, point it tokey.pem
andcertificate.pem
files fromssl/client
directory, leavepass
empty. - Issue request again, you should get the response.