ulisesbocchio / jasypt-spring-boot

Jasypt integration for Spring boot
MIT License
2.88k stars 514 forks source link

jasypt-spring-boot 3.0.4 compatibility problem with Spring Boot 2.5.4 #297

Closed andrew00077 closed 2 years ago

andrew00077 commented 2 years ago

Hi,

if I configure the jasypt-spring-boot version 3.0.4 with Spring Boot 2.5.4 I get the following error: Failed to bind properties under 'spring.datasource.password' to java.lang.String: Reason: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under spring.datasource.password to java.lang.String

Instead if I configure the same test project with and old version e.g. jasypt-spring-boot version 2.1.2 and Spring Boot 2.2.5 everything works fine.

My pom config is the following one:

`

org.springframework.boot
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.5.4</version>
</parent>
     ...
    <dependency>    
        <groupId>com.github.ulisesbocchio</groupId>
        <artifactId>jasypt-spring-boot-starter</artifactId>
        <version>3.0.4</version>
    </dependency>

`

The parameter in the config is something like: spring.datasource.password=ENC(xxx)

What can be the reason? Thanks!

andrew00077 commented 2 years ago

Fixed. It was just a problem of different encryption algorithm between versions. (algorithm=PBEWithMD5AndDES vs algorithm=PBEWITHHMACSHA512ANDAES_256).