Closed aditya170491 closed 3 years ago
@ulisesbocchio ulisesbocchio Please help in resolving the same, am i missing anything , i need this in .yml file
I am facing the same issue. Were you able to resolve this? @aditya170491
@rampollaluis nope , i couldnt able to solve the same, please ping if you find any solution for the same
@ulisesbocchio I'm facing the same issue.my spring-boot version is 2.2.6-RELEASE, my jasypt dependency is jasypt-spring-boot, the version of it is 3.0.2, I added @EnableEncryptableProperties in main class and configured salt value for it. then I got the above error message.
@aditya170491 I noticed the error didn't come up if in the properties folder you included jasypt.encryptor.algorithm = 'PBEWITHHMACSHA512ANDAES_256'
. It is quite strange, since that is supposed to be the default. However, it did produce a different error. This time it was an error connecting to the database, which led me to believe I was inputting the wrong password. I made sure I was generating the key with that same algorithm as well but the error kept appearing. When I didn't use the encrypted string I could connect without a hitch, which tells me my original password was not wrong.
Ultimately I decided to not use jasypt and simply store the data in environmental variables. Not the solution I hoped for but either way you would need to store the password you used to encrypt as an environmental (unless you are using another method), and if someone were to gain access to your environmental variables, they wouldn't have much trouble decrypting.
Sorry this isn't the solution we were hoping for. Hope it helps somewhat, though. Good luck!
@aditya170491 The encrypted value shouldn't be wrapped in quotes. Please try removing these.
It should be password:
ENC(DIVLj0kOOq17tOa+x6ncTY6HC6OXt3aG)
not:
password: "ENC(DIVLj0kOOq17tOa+x6ncTY6HC6OXt3aG)"
It looks like you guys have a config issue. I need to see the entire application.properties/yml and how did you encrypt the secret
@ulisesbocchio here is the complete file
spring: profiles: active: common , dev
spring: profiles: common application: name: hrp-contacts-service jpa: database-platform: org.hibernate.dialect.Oracle10gDialect hibernate.ddl-auto : none show-sql: true
dataSource: url: jdbc:oracle:thin:@10.2...:1791:D33 driverClassName: oracle.jdbc.OracleDriver username: hrprest password: ENC(DIVLj0kOOq17tOa+x6ncTY6HC6OXt3aG) jasypt: encryptor: password: 99PZBVsqKlniKQgVw2DaO3yRcrZsKuKX algorithm: PBEWithMD5AndDES iv-generator-classname: org.jasypt.iv.NoIvGenerator
server: port: 8777
logging:
#org: TRACE
config: logback-config.xml
eureka: instance: instance-id: ${spring.application.name}:${spring.application.instance_id:${random.value}} client: serviceUrl: defaultZone: http://localhost:8760/eureka/
google: geocode: key : AIzaSyC8vmrWsE3d-xU-HswrsUfGG3A0StUrsco
spring: profiles: dev application: name: hrp-contacts-service jpa: database-platform: org.hibernate.dialect.Oracle10gDialect hibernate.ddl-auto : none show-sql: true
dataSource: url: jdbc:oracle:thin:@10.2...:1721:D33 driverClassName: oracle.jdbc.OracleDriver username: hrprest password: ENC(DIVLj0kOOq17tOa+x6ncTY6HC6OXt3aG) jasypt: encryptor: password: 99PZBVsqKlniKQgVw2DaO3yRcrZsKuKX algorithm: PBEWithMD5AndDES iv-generator-classname: org.jasypt.iv.NoIvGenerator google: geocode: key : AIzaSyC8vmrWsE3d-xU-HswrsUfGG3A0StUrsco
Seems you have a configuration properties class and trying to bind properties under 'spring.datasource.password'
where it should be 'spring.datasource
. Where you able to solve this?
See https://github.com/ulisesbocchio/jasypt-spring-boot/issues/222 It seems you have a difference between encryption/decryption algorithms and something's eating up the real exception
most likely this problem: https://github.com/ulisesbocchio/jasypt-spring-boot/issues/241
Description:
Failed to bind properties under 'spring.datasource.password' to java.lang.String:
spring dataSource: url: jdbc:oracle:thin:@10.xx.xx.xxx:1010:xxx password: "ENC(DIVLj0kOOq17tOa+x6ncTY6HC6OXt3aG)" jasypt: encryptor: password: QSSaHkcwFkhcPwC5OefDcEUEHCGJYVBc
i am getting the excepting could you please help me in resolving the same, i don't see any error if i don't use JASYPT : ENC - Encryption.
This fails only when i use OJDBC7 , where as i don't see any issues for using SQL in other project.
could you please Advise .