This guide explains how to configure SSL for the EvTrack Web application using Spring Boot by converting SSL certificate files into the .p12 format and updating the application.properties file.
Prerequisites
Before proceeding, make sure you have the following files:
-
ca_bundle.crt: The certificate authority bundle. -
certificate.crt: Your SSL certificate. -
private.key: Your private key.
Step 1: Convert Certificate Files to .p12 Format
Use the following OpenSSL command to convert your .crt and .key files to a .p12 (PKCS#12) keystore format:
cat certificate.crt ca_bundle.crt > fullchain.pem
openssl pkcs12 -export -in fullchain.pem -inkey private.key -out keystore.p12 -name springboot -CAfile ca_bundle.crt -caname root
Step 2: Update application.properties
Once the .p12 file is generated, configure the service to use SSL by adding the following properties to the application.properties file:
server.port=5443
server.ssl.enabled=true
server.ssl.key-store=keystore.p12
server.ssl.key-store-password=your_keystore_password
server.ssl.key-store-type=PKCS12
server.ssl.key-alias=springboot
Step 3: Restart EvTrack Web Service
After making these changes, restart the service, and it should now be accessible over HTTPS on port 5443.
Troubleshooting
-
Ensure that your keystore file (
keystore.p12) is in the correct location as defined in theapplication.properties. -
Make sure the keystore password is correct.
-
Verify that port
5443is open and not used by any other service.