I have client and server configured to use TLS and self-signed certificate.
Client SSL Engine is configured to use dummy trust manager, which doesn't ever throw CertificateException and empty KeyManager array.
Server SSL Engine uses key store which is initialized with manually generated key store file.
When I run it with JDK 8 I get the following handshake result:
- Server fails to validate certificate
- In client's thread I can see that
io.netty.handler.ssl.SslHandler#setHandshakeFailure
is called andio.netty.handler.ssl.SslHandler#setHandshakeSuccess
is never called.
Which is expected behavior.
When I run it with JDK 11 I get the following:
- server fails with the same error (empty certificate chain) but in client thread I see the following:
io.netty.handler.ssl.SslHandler#setHandshakeSuccess
is called firstio.netty.handler.ssl.SslHandler#setHandshakeFailure
is called after
I'm new to TLS 1.3 and might missed something in configuration. At the same time documentation says there's nothing to update for java TLS API clients to switch to TLS 1.3.
This behavior is confusing and it breaks further logic based on handshakePromise
.
Full code to reproduce the issue is available by gist link: https://gist.github.com/kiturutin/ccb710f67ccfb0a7a7de1fb3b3099b60
It's a groovy script and it first starts server then client.