In the latest update to the JDK in April 2021 (11.0.11+9-0ubuntu2~18.04
) support for TLSv1
and TLSv1.1
was dropped, presumably because since March 2021 those versions are no longer supported. This is evident by the diff in the java.security
file:
Before:
jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, \
EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
include jdk.disabled.namedCurves
After:
jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
include jdk.disabled.namedCurves
which is also discussed in this SO post: SSLHandShakeException No Appropriate Protocol . In that thread there are also more answers popping up the last few days since the updated JDK version.
After this update of the JDK, we received the error
java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
with c3p0
.
After switching to hikari
we got a more meaningful error:
ERROR [2021-04-29 16:21:16,426] com.zaxxer.hikari.pool.HikariPool: HikariPool-1 - Exception during pool initialization.
! javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
We're running on MySQL 5.7.33-0ubuntu0.18.04.1
. Now in my understanding as described here, MySQL 5.7 supports TLSv1.2. Also when running SHOW VARIABLES LIKE 'tls_version';
we get TLSv1,TLSv1.1,TLSv1.2
which suggest that TLSv1.2
is supported.
So then the question is, why don't the JDK and MySQL just agree on using TLSv1.2
and what can we do about it, to make them communicate with TLSv1.2
?
Note: I don't think changing the java.security
file as suggested in the other thread is a good long term solution to this problem!