Closed KingMob closed 1 year ago
@DerGuteMoritz I believe you're the most familiar with this, can you take a look?
It appears the new CircleCI img defaults to JDK 17. We should also update the image name with the openjdk tag to use Java 8: https://hub.docker.com/r/cimg/clojure
(Docker image would be cimg/clojure:1.11.1-openjdk-8.0
)
Thanks, I'll have a look!
OK, turns out this is caused by the fact that with the JDK 8, Netty defaults to TLSv1.2 only. You can see it in the log output when netty is loaded:
DEBUG io.netty.handler.ssl.JdkSslContext - Default protocols (JDK): [TLSv1.2]
With JDK 11 and 17 we get this instead:
DEBUG io.netty.handler.ssl.JdkSslContext - Default protocols (JDK): [TLSv1.3, TLSv1.2]
Now, this matters because the handshake protocol has changed a lot between these versions which results in a different kind of error behavior. Quoting from my recent commit on the issue:
Unfortunately, since TLSv1.3 the connection may still fail with a handshake error even after the handshake has seemingly succeeded. This is because only an invalid certificate is explicitly rejected while a valid certificate will be implicitly accepted. Thus, it's only possible to determine whether the handshake has fully succeeded after having succeessfully read some data. See [1] and [2] for more details. [...]
1: https://github.com/netty/netty/issues/10502 2: https://stackoverflow.com/questions/62459802/tls-1-3-client-does-not-report-failed-handshake-when-client-certificate-verifica/62465859#62465859
The test case is written against the delayed TLSv1.3 error behavior while on JDK 8 we now see the (more eager) pre-TLSv1.3 error behavior which doesn't match the test assertions. One way to solve this would be to make it use TLSv1.3 even on JDK 8 which is indeed supported, just not enabled by default (probably because it was an early version). WDYT?
Given this kind of diverging behavior is possible: Perhaps we should also think about running the test suite against all LTS JDK versions supported by Clojure itself in CI?