1. There are two configurable items on the service side
Spring: Cloud: config: server: encrypt: enabled:falseencrypt: key:12312321
1.1 Spring.cloud.config.server.encrypt.enable This configuration represents whether the data is decrypted on the server side and is true by default.
1.2 If set to True and Encrypt.key is configured, the decryption operation can be performed on the server side, and if there is no Encrypt.key the error will be encountered.
1.2.1 also may not error, this depends on whether the server Qidong load the remote configuration file (Spring.cloud.config.server.clone-on-start), if it is loaded when the error.
1.2.2 also may not have configured the boot-loading mechanism, and will wait until the configuration is used to remotely configure the clone operation.
1.3 If it is false, the ciphertext is sent intact to the client, at this time Encrypt.key dispensable, because not on the server side to decrypt the configuration, so it can not be configured.
2, the client has a configuration item
# Configure server address
Spring
Application:
Name:thunisoft-microservice-foo
Cloud
Config
uri:http://localhost:8979/
Profile:dev
Label:master
# Decrypt secret key
Encrypt: key:12312321
2.1 If the server side is configured with decryption function, when the remote configuration is loaded, the encrypted data is decrypted, the client can do no decryption configuration, can be used directly.
2.2 If the server does not perform the decryption operation, the original encrypted data is returned, then the secret key is configured to decrypt the operation.
The relationship between the Spring Cloud Config server and the client