Issue
TLS protocol version used by default in JDK 11 is TLSv1.3, and connection with third parties can be affected, default protocols are:
-
-Dhttps.protocols=TLSv1.2
(default in Java 8) -
-Dhttps.protocols=TLSv1.3
(default in Java 11) -Dhttps.protocols=TLSv1.0 (default in older versions)
Trying to connect with a third party, protocols supported will be added in the request,
"supported_versions (43)": {
"versions": [TLSv1.3]
}
In order to see all information about connections with https add this property -Djavax.net.debug=ssl:handshake
If protocol between client and server are not the same, the following error is shown:
Received fatal alert: handshake_failure
Environment
- Liferay DXP 7.3
Resolution
In order to solve this problem, TLS protocol can be configured adding this property:
-Dhttps.protocols=TLSv1.2,TLSv1.3 (Only for https connections)
-Djdk.tls.client.protocols=TLSv1.2,TLSv1.3 (For all kinds of connections)
Additional Information
- https://stackoverflow.com/questions/61478298/since-openjdk-java-11-getting-javax-net-ssl-sslhandshakeexception-received-fata
- https://www.oracle.com/java/technologies/javase/11-relnote-issues.html#:~:text=The%20JDK%2011%20release%20includes%20an%20implementation%20of%20the%20Transport,1.3%20specification%20(RFC%208446).