I have enabled HTTPS in my spring boot application using following properties :
server.port: 8443
server.ssl.key-store: classpath:key_store.p12
server.ssl.key-store-password: abc123
server.ssl.keyStoreType: PKCS12
server.ssl.keyAlias: alias1
I have this application running on AWS ECS FARGATE container. Since it is not a good practice to keep the certificate in the classpath and dockerize it along with the application, I'd like to store the certificate in a AWS S3 bucket and download it during runtime using AWS SDK (I do not want to install AWS CLI on my Docker and import the certificate through CLI commands). Following are my questions:
- Is it possible to download the PKCS12 file from S3 bucket inside my application's classpath through AWS SDK? When it is running on AWS FARGATE container?
- How do I set the keystore path and password programmatically?
- Is there a better way of doing the whole set up other than this?