"SSLException: No PSK available. Unable to resume" error is thrown and Elasticsearch Monitoring/X-Pack Monitoring widget is broken with Kibana 7.11+

Environment

  • Liferay DXP 7.1-7.3 with Liferay Enterprise Search subscription
  • Elasticsearch Monitoring/X-Pack Monitoring widget
  • Elasticsearch & Kibana 7.11+
  • JDK 11

Symptom

When Liferay DXP is configured with JDK 11 and is connecting to Elasticsearch and Kibana 7.11+, the following error may occur on certain JDK 11 distributions causing the Elasticsearch Monitoring/X-Pack Monitoring widget not to be rendered:

12:24:42,480 ERROR [http-nio-8080-exec-10][XPackMonitoringProxyServlet:108] javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
	at java.base/sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:526)
	at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:112)
	<truncated for clarity>
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1601) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:834) 12:24:42,483 ERROR [http-nio-8080-exec-4][XPackMonitoringProxyServlet:108] javax.net.ssl.SSLException: No PSK available. Unable to resume. javax.net.ssl.SSLException: No PSK available. Unable to resume. at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:129) at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:264) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:255) at java.base/sun.security.ssl.ServerHello$T13ServerHelloConsumer.consume(ServerHello.java:1224) at java.base/sun.security.ssl.ServerHello$ServerHelloConsumer.onServerHello(ServerHello.java:984) at java.base/sun.security.ssl.ServerHello$ServerHelloConsumer.consume(ServerHello.java:872) at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:444) at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:421) at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:178) at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:543) at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:409) at

Resolution

The error is most probably caused by a race condition in JDK 11 when TLSv1.3 is used (see JDK-8213202). (Kibana 7.11.0 moved to NodeJS 12 which defaults to TLSv1.3.)

The recommended solution is to disable TLSv1.3 in your Liferay DXP-Kibana stack using one of the following methods:

  • Option A: Disable TLSv1.3 for outbound connections in Tomcat by setting -Dhttps.protocols=TLSv1.1,TLSv1.2 in Tomcat's setenv.bat/sh (add to CATALINA_OPTS) when running the X-Pack tests.
  • Option B: Disable TLSv1.3 in Kibana by adding --tls-max-v1.2 to KIBANA_HOME/config/node.options.

Switching to a JDK 11 version where this issue is already fixed is also an option. According to Liferay's tests, this error can still be reproduced with Oracle JDK 11.0.9, however it seems to be fixed in OpenJDK 11.0.9. (Investigation was conduced on LPS-128591.)


Elastic, Elasticsearch, and X-Pack are trademarks of Elasticsearch BV, registered in the U.S. and in other countries.

¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0