n00bst3r
n00bst3r

Reputation: 647

Spring boot with ssl enabled and Elastic Beanstalk - Files not found

I set up a spring boot app with ssl enabled = true. On my local machine everything works fine and as expected. My truststore and keystore are separate files. Both are located under src/main/resources/static/ssl/. So far so good. But if I deploy my application on elastic beanstalk i get the following log:

java.io.FileNotFoundException: /var/app/current/src/main/resources/static/ssl/keystore.p12 (No such file or directory)

Why does my app not recognize this path in elastic beanstalk?I set the paths in the application.properties file. Do I have to set the path additionally anywhere?

The Problem isn't here that ssl doesn't work, but the files aren't found.

Upvotes: 1

Views: 1135

Answers (1)

n00bst3r
n00bst3r

Reputation: 647

Okay, the solution is actually quite easy. In the application properties file you have only to set classpath before it. So i moved the files in the src/main/resources folder and set them in the properties file this way:

server.ssl.key-store =classpath:keystore.jks

That's it.

Upvotes: 1

Related Questions