When calling:
MQQueueConnectionFactory cf ...
cf.createConnection();
The com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.handshakeCompleted method begins:
public void handshakeCompleted(HandshakeCompletedEvent event) {
X509Certificate[] peerCertificateChain = event.getPeerCertificateChain();
...
getPeerCertificateChain in javax.net.ssl.SSLSession:
default X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException {
throw new UnsupportedOperationException("This method is deprecated and marked for removal. Use the getPeerCertificates() method instead.");
}
causing this exception:
Exception in thread "HandshakeCompletedNotify-Thread" java.lang.UnsupportedOperationException: This method is deprecated and marked for removal. Use the getPeerCertificates() method instead.
at java.base/javax.net.ssl.SSLSession.getPeerCertificateChain(SSLSession.java:295)
at java.base/javax.net.ssl.HandshakeCompletedEvent.getPeerCertificateChain(HandshakeCompletedEvent.java:173)
at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.handshakeCompleted(RemoteTCPConnection.java:2448)
at java.base/sun.security.ssl.TransportContext$NotifyHandshake$1.run(TransportContext.java:685)
at java.base/sun.security.ssl.TransportContext$NotifyHandshake$1.run(TransportContext.java:682)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.base/sun.security.ssl.TransportContext$NotifyHandshake.run(TransportContext.java:682)
at java.base/java.lang.Thread.run(Thread.java:832)
The project's only IBM MQ dependency is:
com.ibm.mq:com.ibm.mq.allclient:9.2.0.0
Why is javax.net.ssl.getPeerCertificateChain() calling that deprecated method? It looks like the problem is in the HandshakeCompletedEvent class, not MQ.
Edit: This issue started with Java 15.
com.ibm.mq:com.ibm.mq.allclient:9.2.0.0
should work on Java 15? – Justin Bertram