From e52b1bd0ede200007c66ada57dd17775d0b3589d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Baptiste=20Onofr=C3=A9?= Date: Wed, 12 Jan 2022 08:48:00 +0100 Subject: [PATCH] [AMQ-8445] Fix SSLParameters set in the SSL transport (cherry picked from commit c2e2c818b529ee45ff244564ea52206b81eaf783) --- .../org/apache/activemq/transport/tcp/SslTransport.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java b/activemq-client/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java index 6e24558f27..770c3aa1a0 100644 --- a/activemq-client/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java +++ b/activemq-client/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java @@ -129,7 +129,11 @@ public class SslTransport extends TcpTransport { sslParams.setEndpointIdentificationAlgorithm("HTTPS"); } - ((SSLSocket)this.socket).setSSLParameters(sslParams); + if (remoteLocation != null || verifyHostName) { + // AMQ-8445 only set SSLParameters if it has been populated before + ((SSLSocket) this.socket).setSSLParameters(sslParams); + } + super.initialiseSocket(sock); }