ARTEMIS-2248 don't create sslEngine w/sniHost in NettyConnector
authorJustin Bertram <jbertram@apache.org>
Wed, 6 Feb 2019 17:12:53 +0000 (11:12 -0600)
committerClebert Suconic <clebertsuconic@apache.org>
Thu, 7 Feb 2019 15:04:52 +0000 (10:04 -0500)
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java

index 3467f1b..fa0682e 100644 (file)
@@ -649,8 +649,8 @@ public class NettyConnector extends AbstractConnector {
       SSLEngine engine = Subject.doAs(subject, new PrivilegedExceptionAction<SSLEngine>() {
          @Override
          public SSLEngine run() {
-            if (verifyHost) {
-               return context.createSSLEngine(sniHost != null ? sniHost : host, port);
+            if (host != null && port != -1) {
+               return context.createSSLEngine(host, port);
             } else {
                return context.createSSLEngine();
             }
@@ -690,8 +690,8 @@ public class NettyConnector extends AbstractConnector {
       SSLEngine engine = Subject.doAs(subject, new PrivilegedExceptionAction<SSLEngine>() {
          @Override
          public SSLEngine run() {
-            if (verifyHost) {
-               return context.newEngine(alloc, sniHost != null ? sniHost : host, port);
+            if (host != null && port != -1) {
+               return context.newEngine(alloc, host, port);
             } else {
                return context.newEngine(alloc);
             }