我正在尝试从配置服务器加载解密的配置属性,但因以下错误而失败:
2018-08-07 09:58:26.534 WARN 20400 --- [nio-8888-exec-3] osccseCipherEnvironmentEncryptor:无法解密密钥:密码(类 java.lang.IllegalStateException:无法从商店加载密钥:类路径资源 [服务器.jks])
当 server.jks 放在类路径中时会发生此错误。但是当放置在 C:\drive 位置时它工作正常。
我的配置服务器 bootstrap.yml:
encrypt:
key-store:
# location: file:///C:/keystore/server.jks #using asymmetric encryption
location: classpath:/server.jks #using asymmetric encryption
password: springcloudconfig
alias: testconfigkey
secret: springcloudconfig
# key: springcloudconfig #using symmetric encryption
知道我缺少什么吗?非常感谢您的帮助!Spring Boot:2.0.3 JCE 安装 jre/lib 位置
我只是注意到 server.jks 文件在配置服务器项目中不存在。放置文件后,它正确解密了内容。
Github 中提供了源代码:
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句