We get the call SSLContext.getInstance("TLS")
reported as vulnerability. The recommended fix is to use SSLContext.getInstance("TLSv1.2")
.
I learnt that TLSv1.1 and TLSv1 are disabled anyway since April 2021 in Java implementations, but when I experimented with this fix, I found out that this will disable TLSv1.3 (even if I add it via sslSocket.setEnabledProtocols(protocols)
).
When I use SSLContext.getInstance("TLSv1.3")
, sslSocket.getEnabledProtocols()
returns both TLSv1.3 and TLSv1.2 and if the server side only supports TLSv1.2, a connection is established.
This is unexpected to me. For me, this would be an "algorithm downgrade".
Documentation says only "may support other SSL/TLS versions", so when I specify "TLSv1.3", I cannot expect that fallback to "TLSv1.2" works, right?
Although it looks like the SSLContext.getInstance
parameter is the highest supported TLS version.
So what is the right way to implement an SSL connection were the server side may support either TLSv1.2 or TSLv1.3 or both (and don't get a vulnerability reported)?
Regards, Andreas