You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2020/03/05 16:22:24 UTC

[activemq] branch master updated: [AMQ-7301] Improve logging when initialize Stomp NIO SSL connection

This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/master by this push:
     new b60efea  [AMQ-7301] Improve logging when initialize Stomp NIO SSL connection
     new 4a2881f  Merge pull request #501 from jbonofre/AMQ-7301
b60efea is described below

commit b60efeaad82c63d4b00eb83285b6701ae3e7a73e
Author: jbonofre <jb...@apache.org>
AuthorDate: Thu Mar 5 07:54:28 2020 +0100

    [AMQ-7301] Improve logging when initialize Stomp NIO SSL connection
---
 .../src/main/java/org/apache/activemq/broker/TransportConnector.java | 5 ++++-
 .../org/apache/activemq/transport/stomp/StompNIOSSLTransport.java    | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnector.java b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnector.java
index 20a2394..1008285 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnector.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnector.java
@@ -241,8 +241,11 @@ public class TransportConnector implements Connector, BrokerServiceAware {
                 if (brokerService != null && brokerService.isStopping()) {
                     LOG.info("Could not accept connection during shutdown {} : {}", (remoteHost == null ? "" : "from " + remoteHost), error.getLocalizedMessage());
                 } else {
-                    LOG.warn("Could not accept connection {} : {}", (remoteHost == null ? "" : "from " + remoteHost), error.getLocalizedMessage());
+                    LOG.debug("Could not accept connection from {}: {}", remoteHost, error.getMessage());
                     LOG.debug("Reason: " + error.getMessage(), error);
+                    if (error != null && error.getMessage() != null && remoteHost != null) {
+                        LOG.warn("Could not accept connection from {}: {}", remoteHost, error.toString());
+                    }
                 }
             }
         });
diff --git a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompNIOSSLTransport.java b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompNIOSSLTransport.java
index 5e899ae..beefa8f 100644
--- a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompNIOSSLTransport.java
+++ b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompNIOSSLTransport.java
@@ -26,6 +26,7 @@ import java.security.cert.X509Certificate;
 
 import javax.net.SocketFactory;
 import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLHandshakeException;
 
 import org.apache.activemq.transport.nio.NIOSSLTransport;
 import org.apache.activemq.wireformat.WireFormat;
@@ -64,7 +65,7 @@ public class StompNIOSSLTransport extends NIOSSLTransport {
                 serviceRead();
             }
         } catch (IOException e) {
-            LOGGER.warn("Could not initialize connection from {}", socket.getInetAddress().getHostAddress(), e);
+            LOGGER.warn("Could not initialize connection from {}: {} ({})", socket.getInetAddress().getHostAddress(), e.getMessage(), e.getCause().getMessage());
         }
     }