Spring Cloud Config encrypt endpoint giving java.lang.UnsupportedOperationException with JDK11

689 Views Asked by At

I want to encrypt my passwords with Spring Cloud Config Server. Below are my file changes.

bootstrap.properties

encrypt.key=%gdba$!

pom.xml

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
</dependency>  

With JDK1.8, After manually setting up JCE inside my JDK. I am able to get encrypted results after hitting

POST : http://localhost:9090/config/encrypt

But when I try same thing with JDK11, it is giving me below error:

java.lang.UnsupportedOperationException: No encryption for FailsafeTextEncryptor. Did you configure the keystore correctly?

As per https://www.oracle.com/java/technologies/javase-jce-all-downloads.html JCE setup is not required after JDK8. Where am I going wrong.

Full stack trace : enter image description here

1

There are 1 best solutions below

0
Leroy On

Adding this dependency solved the problem for me

<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-rsa</artifactId>
</dependency>