ssl-config icon indicating copy to clipboard operation
ssl-config copied to clipboard

Jdk 20 compatibility

Open Nezisi opened this issue 1 year ago • 2 comments

ssl-config uses sun.security - which breaks in JDK 20 plus.

https://github.com/lightbend/ssl-config/issues/367

While many of the deprecated sun.* libraries have a counterpart, the X509Certificate doesn't.

https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/security/cert/X509Certificate.html

It's an abstract class, building a certificate isn't possible (as far as I know :) ).

Given that Play Framework and other projects rely on ssl-config, the path of "minimal pain" is to use bouncy castles JCA classes to create a drop-in replacement for the Fake TLS certificate generations.

The remaining commits remove all @Deprecated methods / classes / ... and try to update the project to a releasable new version.

There is a gotcha regarding Scala support, which I cannot fix as my Scala knowledge is pretty minimal: com/typesafe/sslconfig/ssl/Config.scala utilizes scala.language.existentials which got removed in Scala 3. The test fails for the class, though I'm not entirely sure if the lack of existentials in Scala 3 is the problem or sth else.

I published the generated artifacts locally and the Playframework 2.9 tests ran successfully.

Nezisi avatar Jul 27 '23 23:07 Nezisi

Hi @Nezisi,

Thank you for your contribution! We really value the time you've taken to put this together.

Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement:

https://www.lightbend.com/contribute/cla

lightbend-cla-validator avatar Jul 27 '23 23:07 lightbend-cla-validator

Hi @lightbend-cla-validator CLA is signed

Nezisi avatar Jul 27 '23 23:07 Nezisi