Posts

Showing posts from March, 2019

How to configure truststore at springboot

Image
In this tutorial, we would like to setup a truststore in our springboot application. To support https in SpringBoot, we need to generate self-signed certificate by java keytool. I assume that a springboot application is ready. We are going to focus on keystore and truststore configuration. In this step, we as a server. We need to generate a java keystore by keytool. keytool -genkey -keyalg RSA -alias dataflow -keystore dataflow.jks -keypass dataflow -storepass dataflow -validity 365 -keysize 4096 -dname "CN=localhost, OU=spring" if we run our application at local environment, CN set to localhost. eg. CN=localhost. Now, we as a client. We want to generate client certificate. We named the keystore as client_keystore . The step is similar the step on top.  keytool -genkey -keyalg RSA -alias client -keystore client_keystore.jks -keypass password -storepass password -validity 365 -keysize 4096 -dname "CN=user, OU=spring" After that, We would like to co