Describe the bug In config server documentation:
The Config Server can use a symmetric (shared) key or an asymmetric one (RSA key pair). The asymmetric choice is superior in terms of security, but it is often more convenient to use a symmetric key since it is a single property value to configure in the bootstrap.properties.
To configure a symmetric key, you need to set encrypt.key to a secret String (or use the ENCRYPT_KEY environment variable to keep it out of plain-text configuration files).
I configured encrypt.key in bootstrap.properties. Then I posted to /encrypt
. I get an error:
java.lang.UnsupportedOperationException: No encryption for FailsafeTextEncryptor. Did you configure the keystore correctly?
If I move encrypt.key to application.properties then the endpoint work as expected.
Spring boot cloud version: 2021.0.4 Spring boot version: 27.4 java: openjdk 17.0.2
Not sure if its a documentation or framework bug or may be a configuration problem from my side.
Comment From: ryanjbaxter
If you put, spring-cloud-starter-bootstrap
on the classpath does it then work in bootstrap.properties?
Comment From: mateofacu
It works adding the starter dependency.
I thought it was a legacy not neccesary bootstrap mechanism. I misunderstood the documentation.
As I read in config client docs:
To use the legacy bootstrap way of connecting to Config Server, bootstrap must be enabled via a property or the spring-cloud-starter-bootstrap starter
in https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#config-first-bootstrap
Thank you !
Comment From: ryanjbaxter
Actually we should clarify this in the documentation