clj-commons / aleph

Asynchronous streaming communication for Clojure - web server, web client, and raw TCP/UDP
http://aleph.io
MIT License
2.54k stars 241 forks source link

dependency: bouncycastle must be a dev dependency #634

Closed arnaudgeiser closed 2 years ago

arnaudgeiser commented 2 years ago

Description

Aleph cannot be compiled on Java > 9 when bouncycastle is not included as a dependency. [1] As lein test loads both the dev and test profile, everything is fine. However, a REPL without with-profile +test results on bouncycastle not being included which fallback to OpenJdkSelfSignedCertGenerator and thus :

Execution error (IllegalAccessError) at io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator/generate (OpenJdkSelfSignedCertGenerator.java:52).
class io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator (in unnamed module @0x3bb50eaa) cannot access class sun.security.x509.X509CertInfo (in module java.base) because module java.base does not export sun.security.x509 to unnamed module @0x3bb50eaa

Let's add bouncycastle as a dev dependency instead. To help diagnose this issue, I also changed -Dorg.slf4j.simpleLogger.defaultLogLevel=debug on :dev profile.

[1] : https://github.com/netty/netty/blob/4.1/handler/src/main/java/io/netty/handler/ssl/util/SelfSignedCertificate.java#L238-L255