Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 43F06200C78 for ; Wed, 3 May 2017 16:06:53 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 429FC160BAA; Wed, 3 May 2017 14:06:53 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 891DD160BB5 for ; Wed, 3 May 2017 16:06:52 +0200 (CEST) Received: (qmail 65033 invoked by uid 500); 3 May 2017 14:06:51 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 64941 invoked by uid 99); 3 May 2017 14:06:51 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 May 2017 14:06:51 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9667AE04AA; Wed, 3 May 2017 14:06:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: clebertsuconic@apache.org To: commits@activemq.apache.org Date: Wed, 03 May 2017 14:06:52 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] activemq-artemis git commit: ARTEMIS-1102 Fixing Openwire test after security change archived-at: Wed, 03 May 2017 14:06:53 -0000 ARTEMIS-1102 Fixing Openwire test after security change Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/2968e0a7 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/2968e0a7 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/2968e0a7 Branch: refs/heads/master Commit: 2968e0a7dac85ad08fe34552e274f329e695fd94 Parents: 174b238 Author: Clebert Suconic Authored: Wed May 3 10:06:45 2017 -0400 Committer: Clebert Suconic Committed: Wed May 3 10:06:45 2017 -0400 ---------------------------------------------------------------------- .../core/protocol/openwire/OpenWireProtocolManager.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2968e0a7/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java index 61eeb1c..09c6509 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java @@ -34,6 +34,7 @@ import io.netty.channel.ChannelPipeline; import io.netty.handler.codec.LengthFieldBasedFrameDecoder; import org.apache.activemq.advisory.AdvisorySupport; import org.apache.activemq.artemis.api.core.ActiveMQBuffer; +import org.apache.activemq.artemis.api.core.ActiveMQSecurityException; import org.apache.activemq.artemis.api.core.BaseInterceptor; import org.apache.activemq.artemis.api.core.Interceptor; import org.apache.activemq.artemis.api.core.RoutingType; @@ -289,7 +290,14 @@ public class OpenWireProtocolManager implements ProtocolManager, Cl String username = info.getUserName(); String password = info.getPassword(); - validateUser(username, password, connection); + try { + validateUser(username, password, connection); + } catch (ActiveMQSecurityException e) { + // We need to send an exception used by the openwire + SecurityException ex = new SecurityException("User name [" + username + "] or password is invalid."); + ex.initCause(e); + throw ex; + } String clientId = info.getClientId(); if (clientId == null) {