If you try to set the encrypt.keyStore.* properties in application.yml, you get the following error:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-08-28 20:22:00.550 ERROR 31486 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
APPLICATION FAILED TO START
Description:
Field rsaProperties in org.springframework.cloud.config.server.config.EncryptionAutoConfiguration$KeyStoreConfiguration required a bean of type 'org.springframework.cloud.bootstrap.encrypt.RsaProperties' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.cloud.bootstrap.encrypt.RsaProperties' in your configuration.
There is a question on stackoverflow of someone else having a similar issue.
Move the encrypt.keyStore.* properties to bootstrap.yml
https://github.com/mjohns39/ResumeWebsiteApi/tree/spring-cloud-rsa-issue
This is not a work around, it is the documented proper procedure to put these values in bootstrap
Why would adding the properties in application.yml cause an error then? If anything, shouldn't spring cloud just ignore the properties in application.yml?
Let's create a failure analyzer that suggests to move the properties to bootstrap.
Most helpful comment
Let's create a failure analyzer that suggests to move the properties to bootstrap.