jasypt - Jasypt spring boot starter not working with bootstrap.propetites
问题描述
I have added jasypt spring boot starter 1.18 version in pom as my spring boot version is 1.5.16. I am trying to encrypt bootstrap.properties which is used to access spring cloud config server URL, username and password. The password is in jasypt encrypted format however while connecting to the spring cloud config server it's not sending decrypted value. Does anyone know how to encrypt the value of bootstrap.propetites using Jasypt? I tried all the available options.
解决方案
It was a problem of jasypt.encryptor.* properties. In latest version which is 3.0.2 as of now jasypt.encryptor.iv-generator-classname is supported however in 1.18 it is not supported (Jasypt git 1.18). The encrypted password was generated with 3.0.2 version by mistake and decryption was done in 1.18 version hence It was not matching and It was unable to decrypt it. Answer is use the same version for encryption and decryption and always check the properties available in the version which is been used here .It was my bad due to working on parallel microservices which use different version of jasypt!
推荐阅读
- scala - 如何根据数据类型在 Spark Dataframe 中动态更改列数据类型
- javascript - 如何将 PDF 嵌入 Firefox 的 html 页面的一部分
- vue.js - Vuetify 与 3rd 方表单组件 - 如何像 v-text-field 一样设置样式
- ruby-on-rails - 无法通过 Bundler 安装 gem。偏僻的: !偏僻的: !Push 被拒绝,无法编译 Ruby 应用程序。远程:远程:!推送失败
- javascript - 通过循环构建 JSON 数组
- python - Python:生成绝对路径
- git - (合并后)在拉取请求中未看到的更改在提交中看到
- macos - IOUSBInterfaceOpen 失败,但我可以通过卸下相机让它工作......这是怎么回事?
- jscript - 如何为 Summernote 的插入图像对话框设置图像扩展名
- python - 在 python 中迭代列表时扩展新列表中的元素