Skip to content

Dependency conflict between spring-boot-starter-remote-shell and spring-security-jwt #3501

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
stdll opened this issue Jul 15, 2015 · 4 comments

Comments

@stdll
Copy link
Contributor

stdll commented Jul 15, 2015

When using both spring-boot-starter-remote-shell and spring-security-jwt there is a version conflict concerning org.bouncycastle:bcpkix-jdk15on.

Simple steps to replicate the issue:

  1. Open Spring Initializr
  2. Use spring-boot 1.2.5.RELEASE, choose Remote Shell and download/open the project
  3. Manually add spring-security-jwt as dependency

The POM should have the following dependencies:

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

spring-boot-starter-remote-shell (1.2.5.RELEASE) needs org.bouncycastle:bcpkix-jdk15on (1.51), but having spring-security-jwt (1.0.3.RELEASE) as dependency leads to version 1.47 to be used.

This will cause errors when using the remote shell as the API of the bouncycastle library has changed considerably between 1.47 and 1.51. More precisely, it causes an exception when someone tries to connect to the remote shell: java.lang.IllegalStateException: Unable to negotiate key exchange for server host key algorithms.

However, the real issue is an InvocationTargetException which is thrown while trying to read the server key due to the incompatible API.

@stdll stdll changed the title Dependency conflicht between spring-boot-starter-remote-shell and spring-security-jwt Dependency conflict between spring-boot-starter-remote-shell and spring-security-jwt Jul 15, 2015
@wilkinsona
Copy link
Member

Have you tried forcing the version of Bouncycastle to 1.47? I believe that the shell will work with both 1.47 and 1.51.

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Jul 15, 2015
@snicoll
Copy link
Member

snicoll commented Jul 15, 2015

See also #2425

@stdll
Copy link
Contributor Author

stdll commented Jul 15, 2015

@wilkinsona Forcing the version to either 1.47 or 1.51 solves the problem.

@wilkinsona
Copy link
Member

That's good news, thanks. I've opened spring-attic/spring-security-oauth#531 to consider enhancing spring-security-jwt to support 1.51.

@wilkinsona wilkinsona removed the status: waiting-for-feedback We need additional information before we can continue label Jul 15, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants