项目名称:国信证券新一代核心交易系统清算中心
KOCA版本 :4.1.0
KOCA模块 :koca-encrypt
模块版本 :4.1.0
场景 :多数据源密码配置成密文
问题 :同一个配置文件中多个配置项加密会被同一个密文密码覆盖
报错细节 :
尝试解决方案:
详细配置如下
koca:
jdbc:
default-data-source-id: koca_quickstart_demo
data-sources:
- id: koca_quickstart_demo
pool:
url: jdbc:mysql://10.202.63.128:3306/koca_quickstart_demo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC&allowMultiQueries=true
username: root
#password: ENC(Ljg/XYwi4izCy3dxelUrdQ==)
password: encrypt(123456)
initialSize: 1
minIdle: 1
maxActive: 100
maxWait: 60000
- id: koca_quickstart_demo_his
pool:
url: jdbc:mysql://10.202.63.128:3306/koca_quickstart_demo_his?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC&allowMultiQueries=true
username: root
password: encrypt(1234567)
initialSize: 1
minIdle: 1
maxActive: 100
maxWait: 60000
jdbc:
decryptKeys: koca.jdbc.data-sources[0].pool.password,koca.jdbc.data-sources[1].pool.password
---
koca:
crypto:
type: aes #加解密算法默认实现,默认sm4
secretKey: TDekbf0zIY4eayW1 #密钥key,默认值不进行说明
aes:
secretKeyLength: 16 #默认16
#加解密算法/工作模式/填充方式
cipherAlgorithm: AES/CBC/PKCS5Padding #默认DES/CBC/PKCS5Padding
解决方案:koca-encrypt升级到4.1.1即可