X.509 to Java Keystore Conversion
Import Self-Signed Server Certificate from Self-Generated CA into Java Keystore¶
Step 1: Convert the x.509 certificate and key to a pkcs12 file¶
- During conversion to pkcs12 file be sure to put an export password for both security and to avoid import issues.
- The
-chain
option is optional, but suggested to preserve the CA certificate chain (i.e. who signed it).1 2
# openssl pkcs12 -export -in server.crt -inkey server.key -out server.p12 -name [some-alias] -CAfile ca.crt -caname root -chain -passin file:servpass.enc openssl pkcs12 -export -in server.crt -inkey server.key -out server.p12 -name cis-18 -CAfile ca.cert.pem -caname root -chain -passin file:servpass.enc
Step 2: Import pkcs12 file Into Java Keystore¶
1 |
|
Step 3: Use this Keystore for your Spring-Boot Tomcat¶
resources/application.properties | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 |
|