We have externalised our application config using Spring cloud config. We also use the Encryption API to encrypt the plain text passwords before they go in yaml property file.
I am struggling with encrypting password for downstream system which has special character at the end. Somehow that’s been ignored by cloud config encryption API. When you decrypt the cipher back using decryption API you get the plain text back without the special character at the end.
I am using curl to invoke the API -
curl 10.102.82.1:11901/encrypt -d AXIzFDH4XZA=
for some reason special characters in middle of the plain text works fine, but if you have it at the end then its ignored. Probably this password is already hashed, but I am still curious to find out how to deal with this.
Set an explicit Content-Type: text/plain to make sure curl encodes the data correctly when there are special characters
curl -H "Content-Type: text/plain" 10.102.82.1:11901/encrypt -d AXIzFDH4XZA=
This is specified in the cloud config documentation, look for TIP on the page - http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_encryption_and_decryption
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With