I created a CSR file using
openssl req -nodes -newkey rsa:2048 -keyout yourdomain.key -out yourdomain.csr –sha256
It created a CSR file and a key file. I submitted the CSR file to a CA. They responded with a single yourdomain.crt a single file.
I've tried to import the yourdomain.crt to my java's cacert by:
keytool -import -keystore /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/security/cacerts -file ~/Desktop/user/yourdomain.crt -alias yourdomain
And now I am confused on how to generate a Keystore (jks file). Do I use the same yourdomain.crt? And what is the command that I should use?
My spring boot program consists of
File trustStoreFile = new File(CACERTS_PATH);
File keyStoreFile = new File(JKS_PATH);
KeyStore ks = KeyStore.getInstance("JKS");
ks.load(new FileInputStream(keyStoreFile), KEY_PASS.toCharArray());
return SSLContextBuilder.create()
.useProtocol("TLS")
.loadKeyMaterial(ks, KEY_PASS.toCharArray())
.loadTrustMaterial(trustStoreFile, TRUST_PASS.toCharArray())
.build();
So I need a cacerts path which I believe is the cacerts from my jdk, and the password is the one which I typed when prompted for it.
Now how do I generate a Keystore file for it?
And do I need to add the server.ssl properties for Spring boot?